Skip to navigationSkip to main contentSkip to footerScaleway DocsSparklesIconAsk our AI
SparklesIconAsk our AI

How to migrate from command to startup command and arguments

The Serverless Jobs v1alpha2 API introduces a new startup execution mechanism based on commands and arguments, replacing the legacy command.

The Scaleway console allows you to quickly and easily migrate your existing jobs to the new system.

Migration from command field to startup_command field is mostly transparent for customers using Scaleway Console but can require some attention of API, CLI and other devtools users.

The change allows for:

  • More customization for executing complex commands, by separating startup_command and args.
  • Better alignment with our underlying Kubernetes implementation.
  • The ability to compute environment variables used in command and argument strings.
  • startup_command is now an array of commands instead of a single string.

Before you start

To complete the actions presented below, you must have:

  • A Scaleway account logged into the console
  • Owner status or IAM permissions allowing you to perform actions in the intended Organization
  • An existing job that uses the legacy command field

How to migrate from command to startup commands and arguments

  1. Click Jobs in the Serverless section of the side menu. The jobs page displays.

  2. Click the name of the job you want to manage, then click the Settings tab.

  3. Scroll down to the Configure advanced options, then click the Execution tab.

  4. Click the Upgrade button. A pop-up displays.

  5. Split your existing startup command into a command (which corresponds to the ENTRYPOINT Docker instruction), and arguments (which correspond to the CMD Docker instruction).

  6. Click Upgrade to the new format to finish.

Your Serverless Job now uses the command and arguments mechanism.

Migration examples

Simple command

Legacy command

sleep 60s

Corresponding command and arguments

startup_command: [sleep]
args: [60s]

Complex command

Legacy command

/app/migrate up --database "$DB_URL" --password "$DB_PASSWORD" --port 3002

Corresponding command and arguments

startup_command: [/app/migrate]
args: [up, --database, "$(DB_URL)", --password, "$(DB_PASSWORD)", --port, 3002]
SearchIcon
No Results