Showing posts with label serverless for beginners. Show all posts
Showing posts with label serverless for beginners. Show all posts

Tuesday, February 20, 2018

Serverless: Getting started with SLAppForge Sigma

Yo! C'mere.

Lookn' for somethn'?

Serverless, ya?

Up there. Go strait, 'n take a right at da "Sigma" sign.

(Well, don't blame us yet; at least we thought it was that easy!)

One of our dream goals was that working with Sigma should be a no-brainer, even for a complete stranger to AWS. However, in the (very likely) event that it is not so yet, here is a short guide on how you can get the wheels turning.

Ingredients

First off, you need:

  • an internet connection; since you are reading this, that's probably already ticked off!
  • an AWS account; you could either create your own free account or ping us via Slack for one of our demo accounts
  • a GitHub account; again, free to sign up if you don't have one already!
  • a "modern" browser; we have tested ourselves on Chrome 59+, Firefox 58+, Edge 41+ and Safari 10.1.2+; other versions would probably work as well :)
  • a mouse, trackball or touchpad (you'll drag quite a bit of stuff around) and a keyboard (you'll also type some stuff)

AWS Credentials

Before firing up Sigma, you need to gather or create some access credentials for allowing Sigma to access your AWS account. Sigma will do a lot on your behalf, including building and deploying your app into your AWS account, so for the moment we need full admin access to your account (we are planning on preparing a minimal set of permissions, so you can sleep well at night).

For obtaining admin credentials for your AWS account:

The easy (but not recommended) way:

Here you will allow Sigma to act as your AWS root user for gaining the required access. Although Sigma promises that it will never share your credentials with other parties (and store them, only if you ask to do so, with full encryption), using root user credentials is generally against the AWS IAM best practices.

  1. Open the Security Credentials page of the IAM dashboard. If AWS asks for your confirmation, click Continue to Security Credentials to proceed.

    AWS IAM: Security Credentials page

  2. Click Access keys (access key ID and secret access key) among the list of accordions on the right pane.

    Root access keys

  3. Click the Create New Access Key button. A pop-up will appear, stating that your access key has been created successfully.
  4. Click Show Access Key, which will display a pane with two parameters: an Access Key ID that looks like AKIAUPPERCASEGIBBERISH and a longer, Secret Access Key. (WARNING: You'll see the latter value only once!)

    Root keypair created

  5. Copy both of the above values to a secure location (or click Download Key File to save them to your filesystem). Combined, they can do anything against anything in your AWS account: the two keys to rule them all.

The detailed version is here.

The somewhat harder (but safer) way:

Here you will create a new administrator group inside your AWS account, create and assign a new user to that group (so that the user would have admin privileges on your account), and feed that user's access credentials to Sigma. This way, you can instantly revoke Sigma's access anytime by disabling/deleting the access keys of the new user, should you ever come to distrust/hate Sigma at some point in time (but don't do that to us, please! :))

  1. Go to the IAM dashboard.
  2. Select Users on the left pane.
  3. Click the Add user button at the top of the right pane.

    AWS IAM: Add User

  4. Type a name (e.g. sigma) for the User name field.
  5. Under Access type, tick Programmatic access, and click Next: Permissions at the bottom right. (Tip: you can get to this point right away, using this shortcut URL.

    User groups and permissions

  6. Click Create group under the Add user to group option. A new pop-up will open.
  7. Type a name (e.g. admin) for the Group name field.
  8. Tick off AdministratorAccess in the list of policies. (It should usually appear at the top of the list; if not, type Administrator in the Filter text box to see it.)

    Create group

  9. Click Create group.
  10. The pop-up will close, and the brand new group will appear in the groups list of the permissions page, already selected (ticked off) for you.
  11. Click Next: Review.
  12. Double-check that your user has a nice name, and that it belongs to the new group you just created. If all looks fine, click Create user.

    Review new user

  13. Once the user is created, you will be shown a Success page with a table containing the Access Key ID and Secret Access Key (masked with * s) of the user.
  14. Click Show against the secret access key, to view its value. (WARNING: You'll see the latter value only once!)

    Key pair of new user

  15. Copy both Access key ID and Secret access key to a safe location (or click Download CSV above).

Here's the official, detailed version.

Once you follow either of the above methods (and have an access key-secret key pair in hand), that's it! You'd no longer need to wander around on the AWS dashboards, as Sigma will handle it all for you.

Signing up with Sigma

Now, you're just three steps away from the awesome Sigma IDE! Let's go one step further by creating a brand new Sigma account (if you don't already have one):

  1. Go to the Sigma sign-in page.
  2. Click the "Create an account" link against the "New to Sigma?" message.
  3. Fill in your first and last names, email, and phone number (if it's okay with you).
  4. Take note of your username: we'll automatically generate one, using your first and last names. If you don't like our taste, you can always type in your own crazy one (as long as another user has not used it already).
  5. Choose a password. We are a bit peculiar about our passwords, so they need to be at least 8 letters long and have at least one from each of the letter categories: uppercase, lowercase, numeric and symbolic (@, $, # etc.). You can press and hold the "show password" button (eye icon) to confirm what you have typed.
  6. When all looks good, click Sign Up.
  7. If we are happy with the info you provided, we'll take you to a confirmation page (Insert Confirmation Code). We'll also send an email to the address you indicated (from noreply@slappforge.com), with a verification code.
  8. Check your mailbox for our email (including promotions, spam, trash etc. in case it does not show up in the inbox). Once you find it, copy the 6-digit confirmation code in the email, paste it into the confirmation page, and click Confirm.
  9. If all goes well, we'll show you a "Confirmation successful!" message, with a link back to the sign-in page.
  10. Go to the sign-in page, and log in using your username (that you took note previously, on the signup page) and password.

Powering up Sigma

Way to go! Just two more steps!

  1. After sign-in, you'll be in an AWS Credentials page.
  2. Now, dig up the "access key ID" and "secret access key" that you retrieved from the AWS console previously, and paste them in the Access Key ID and Secret Key fields, respectively.
  3. Now, you have a decision to make:
    1. Sigma can store these AWS keys on your behalf, so that you will not have to re-enter them at every log-in. We will encrypt the keys with your own password (your password will be in Cognito, AWS's own user management service, so we will never see your password either!), hence rest assured that we, or any other party, will not—and will not be able to—steal your keys :)
    2. If you are a bit too skeptical, you can avoid the storing option by unticking the Save Credentials tick box.
  4. When done, Click Load Editor.

Connecting GitHub

Yay! Last step!

  1. Now you will be in the projects page, with a quickstart pane (saying Integrate Sigma with GitHub!) on the left.

    Sigma Projects page with GitHub integration message

  2. Click the Sign in with GitHub button. A GitHub authorization window will pop up (if it does not, tune your browser to enable pop-ups for sigma.slappforge.com and try again).
  3. On the pop-up, sign in to GitHub if you are not already signed in.
  4. The pop-up asks you to authorize the Sigma GitHub app (made by us, slappforge) to connect with yOnour GitHub account. Click the Authorize slappforge button to continue.
  5. Once done, the pop-up will close, and the quickstart pane will start displaying a bunch of ready-made Sigma projects!
    1. Your Projects tab will display any Sigma-compatible projects that are already in your GitHub account.
    2. Samples tab will display the numerous samples published by SLAppForge, that you can try out right away.

      Sigma sample projects

    3. If you have the GitHub URL of any other Sigma project that you know of, just paste it in the search bar of the Public Repositories tab and hit the search button.
  6. Once you have the project that you were looking for, simply click to load it!

Voilà!

Here comes the Sigma editor, loaded with the project you picked, and ready for action!

Friday, February 16, 2018

Sigma: The New Kid on the Serverless Block

Despite its young age (barely 73 years; in comparison to, say, automobiles (200+), digital computing is growing and flourishing rapidly; and so are the associated tools and utilities. Today's "hot" topic or tech is no longer hot tomorrow, "legacy" in a week and "deprecated" in a month.

Application deployment and orchestration is no exception: in just three decades we have gone from legacy monoliths to modular systems, P2P integration, middleware, SOA, microservices, and the latest, functions or FaaS. The deployment paradigm has shifted to comply, with in-house servers and data centers, enterprise networks, VMs, containers, and now, "serverless".

Keeping up with things was easy so far, but the serverless paradigm demands quite a shift in the developer mindset (not to mention the programming paradigm). This, combined with the lack of intuitive tooling, has fairly hindered the adoption of serverless application development, even among the cutting-edge developers.

And (you guessed it), that's where _____ comes into play.

Missing something?

Yup.

A way to glue stuff together.

A way to compose a serverless application care-free. Without having to worry—and to read tons of documentation, watch reels of tutorials, or trial-and-error till your head is on fire—about all the bells and whistles of the underlying framework and related services.

Essentially, a sum-up of all that is serverless.

Sum.

Sigma.

Σ.

Sigma Logo

What's in a name?

As the name implies, (quoted from the official website)

The Sigma editor is a hybrid between the simplicity of drag-and-drop style development,
and the full and unlimited power of raw code.

The drag-and-drop events generate sample or usage snippets to quickly get started,
and introduce a powerful, uniform and intuitive library with auto-completion,
which allow users to quickly become productive in developing Serverless applications
that integrate with a myriad of AWS based services.

Making of...

Before Sigma, a bit of background of its origins.

As a first-time user of AWS Lambda, one of our team members brought up an impressive series of questions: if serverless is so cool, why is it so complicated to get an application up and running in Lambda?

(His quest, converted into a presentation, is [right here].)

And we ourselves started trying out the same thing. Guess what, we got the same questions as well.

So we set out to devise something that could bypass all those tedious steps: something where we could just write our code, save it, and deploy it as a working serverless application, without having to wander from dashboard to dashboard, or sift through heaps of documentation or reels of video tutorials.

And we ended up with Sigma!

Yet another IDE?

At first glance, Sigma looks like another cloud IDE that additionally supports deploying an application directly into a serverless provider environment (AWS so far).

However, there are a few not-to-be-missed distinctions:

  • Unlike many of the existing cloud IDEs, Sigma itself is truly serverless; it runs completely inside your browser, using backend services only for user authentication and analytics, and requires no dedicated server/VM/container to be running in the background. Just fire up your browser, log in, and start coding your dream away.
  • Sigma directly interacts with and configures the serverless platform on your behalf, using the credentials that you provide, saving hours of configuration and troubleshooting time. No more back-and-forth between overcomplicated dashboards and dizzying configurations.
  • Sigma encapsulates the complexities of the serverless platform, such as service entities, access policies, invocation trigger configurations and associated permissions, and even some API invocation syntaxes, saving you the trouble of having to delve into piles of documentation.
  • All of this comes in a fairly simple, intuitive environment, with easy, drag-and-drop composition combined with the full power of written code. Drag and drop a DynamoDB table into the UI, pick your operation and just write your logic, and Sigma will do the magic of automatically creating, configuring and managing the DynamoDB table on your AWS account.

Now, I won't say that's "just another IDE"; what say you?

A serverless platform?

Based on the extent of its capabilities, you may also be inclined to classify Sigma as a serverless platform. This is true to a great extent; after all, Sigma facilitates all of it—composing, building and deploying the application! However...

Hybrid! It's a hybrid!

Yup, Sigma is a hybrid.

Fusion of a cloud IDE (which in itself is a hybrid of graphical composition and granular coding) and a serverless development framework (which automatically deploys and manages the resources, permissions, wiring and other bells and whistles of your serverless application).

One of a kind.

To be precise, the first of its kind.

A new beginning

With Sigma, we hope to redefine serverless development.

Yup. Seriously.

From here onwards, developers shall simply focus on what they need to achieve: workflow, business logic, algorithm, whatever.

Not about all the gears and crankshafts of the platform on which they would deploy the whole thing.

Not about the syntax of, or permissions required by, platform-specific API or service calls.

Not about the deployment, configurations and lifecycle of all the tables, buckets, streams, schedulers, REST endpoints, queues and so forth, that they want to use within their application.

Because Sigma will take care of it all.

And we believe our initiative would

  • make it easy for newcomers to get started with serverless development,
  • improve the productivity of devs that are already familiar with—or even experts of—serverless development,
  • speed up the adoption of serverless development among the not-yet-serverless community,
  • allow y'all to "think serverless", and
  • make serverless way much fun!

We have proof!

While developing Sigma, we also wanted to verify that we were doing the right thing, and doing it right. So we bestowed upon two of our fellows, the responsibility to develop two showcase applications using Sigma: a serverless accounting webapp, and a location-based mobile dating app.

To our great joy, both experiments were successful!

The accounting app SLAppBook is now live for public access. By default it runs against one of our test serverless backends, but you can always deploy the serverless backend project on your own AWS account via Sigma and point the frontend to your brand new backend, after which you can use it for your own personal use!

The dating app HotSpaces is currently undergoing some rad improvements (see, now it's the frontend that takes time to develop!) and will be out pretty soon!

So, once again, we have proof that Sigma really rocks it!

Far from perfection, but getting there; fast!

Needless to say, Sigma is pretty much an infant. It needs quite a lot more—more built-in services, better code suggestions, smarter resource handling, faster builds and deployments, support for other cloud platforms, you name it—before it can be considered "mature".

But we are getting there. And we will get there. Fast.

We will publish our roadmap pretty soon, which would include (among other things) adding more AWS services, supporting integration with external APIs/services and, most importantly, expanding to other cloud providers like GCP and MS Azure.

That's where we need your help.

We need you!

Needless to say, you are most welcome to try out Sigma. Sign up here, if you haven't already, and start playing around with our samples (once you are signed in to Sigma, you can directly open them via the projects page). Or, if you feel adventurous, start off with a clean slate, and start building your own serverless application.

We are continually smoothening the ride, but you may hit a few bumps here and there. Possibly even hard ones. Sometimes even impassable. Maybe none, if you are really lucky.

Either way, we are eagerly waiting for your feedback. Just write us about anything that came to your mind: a missing functionality, a popular AWS service that you really missed in Sigma (there are hundreds, no doubt!), the next cloud platform you would like Sigma to support; a failed build, a faulty deployment, a nasty error that hogged your browser; or even the slightest of improvements that you would like to see, like a misaligned button, a hard-to-scroll pop-up or a badly-named text label.

You can either use our official feedback form or the "Report an Issue" option on the IDE Help menu, post your feedback in our GitHub issue tracker, or send us a direct email at info@slappforge.com.

If you would like to join hands with us in our forward march, towards a "think serverless" future, drop us an email at info@slappforge.com right away.

Welcome to Sigma!

That's it; time to start your journey with Sigma!

(Originally authored on Medium.)