Page MenuHomePhabricator

Toolforge next user stories - 2024 version
Closed, ResolvedPublic

Description

Sorry about the crappy title, this is half-baked at best. We've been dancing around this when talking about some current tasks and future developments. Especially for the buildservice, I think we are mostly in agreement that we don't want users to think about "containers", "images", "k8s", "harbor" etc. But where do we draw the line? And what do we call the different concepts/components? This task is meant to be a conversation-starter.

Moving the brainstorming here for easy collab: https://docs.google.com/document/d/1sqo6YGRn9u-S7V0y9m07cYKA84vQlKa-7_F8p7eg80Y/edit

For inspiration, let's see how Heroku does it.

In Heroku, theres is the "process" concept. Processes correspond to well... mostly actual unix processes. These can be defined in the Procfile (the 'special' web process being inferred if the Procfile is absent). In terms of deployments, the unit is called a "Dyno" which they say are lightweight Linux containers, where 1 process = 1 dyno.

  • heroku ps will give you the number of dynos that are executing
  • heroku logs lets you view an aggregated list of log messages from all dynos across all process types
  • Dynos can be scaled, including web dynos
  • Users can exec into dynos

Etc.

The Dynos are managed by the Dyno Manager, which smells like k8s or some other orchestration engine. All of this is abstracted, as are builds, images, etc. Builds happen underneath deployments. Deployments are preceded by creating the app:

When you create an app, a git remote called heroku is also created and associated with your local git repository. Git remotes are versions of your repository that live on other servers. You deploy your app by pushing its code to that special Heroku-hosted remote associated with your app.

Event Timeline

Thanks for starting this!

Adding a bit more detail, the top level abstractions are "apps" and "pipelines".

Inside an "app" there's one single code base, linked to one of:

  • Git repo
  • Github repo
  • Container image

For this "app" you can define:

  • The "dyno type", that defines the resources that will be available to the processes you run (they only advertise RAM, and if they are run in a shared environment or not, but no cpu/network/io numbers), this allows you to choose "basic" or "professional".
    • basic applies to all your dynos, and uses the same resources for each (a very minimal amount)
    • professional allows you to choose per-dyno what resources it will use (dropdown of RAM amounts and shared env or not)
  • The list of "dynos" that you can run, extracted from the Procfile (one per entry there, adding the web one if not there), and can't be changed manually from the UI
  • Then there's "addons" that allow you to instantiate things like a redis DB and such.
  • There's also "one-off dynos", but not really scheduled ones: The one-off dynos are exclusively interactive, and if you want to schedule them, you have to use an extension that will run them for you using puts from ruby. Other than that, the recommendation seems to be to build your own scheduler and run it with just 1 replica.
  • You can also set "config vars" for an application, they show up as env vars on all the "dynos" of that application (no way to filter them out), there's some special namings that will make them appear at build time though. Those are all available to the buildpack compile step, it's up to the buildpack to use them or not.

For the "pipeline":

  • There's 3 environments hardcoded, development, staging and production
  • You can move an application from one environment to the other
  • They seem to recommend this as an alternative to the git deployment for stateless apps as all the config needs to be in the environment and not built into the application

That's nicely detailed!

Something else I'd like as a user is when I run a maintenance task like a db migration, I don't want to be exposed to the jobs framework but rather just do something like toolforge run migrate where migrate is the process name defined in the Procfile.

Oh, yes, heroku has that special "release" procfile entry, that it runs on every "deployment", that is done every time you push to your git repo, or manually trigger it.

https://devcenter.heroku.com/articles/release-phase#specifying-release-phase-tasks

Ah yes. I was wondering if that runs as some sort of init container, but no, they say it's a one-off dyno so it's basically just a regular job?

Ah yes. I was wondering if that runs as some sort of init container, but no, they say it's a one-off dyno so it's basically just a regular job?

Yep, I think so

dcaro renamed this task from Decide what abstractions we want to expose to Toolforge users in the longer term to Toolforge next user stories - 2024 version.Jan 10 2024, 12:04 PM
dcaro updated the task description. (Show Details)
dcaro changed the task status from Open to In Progress.Jan 23 2024, 2:23 PM
dcaro claimed this task.
dcaro moved this task from Next Up to In Progress on the Toolforge (Toolforge iteration 03) board.