How do I upload a Docker image to the FINBOURNE AWS store?

Providing you are a LUSID user with sufficient access control permissions, you can upload a Docker image to the FINBOURNE AWS store. Once the image is uploaded, you can use it to create a job.

Note: If you are the LUSID domain owner, you are automatically assigned the built-in lusid-administrator role, which has all the permissions necessary to perform the operations in this article.

The instructions on this page do not actually upload an image for you. Instead, they generate a series of commands—authentication credentials and Docker build instructions—that you then run yourself in order to log in, build the image with the correct version tags, and push it to AWS.

Note: Your image must not contain any Critical or High vulnerabilities. Read more on troubleshooting Docker image vulnerabilities.

Using the Scheduler REST API

For example, to upload the lusid-upsert-transactions-image created in Step 1 of this tutorial:

  1. Obtain an API access token.

  2. Call the UploadImage API, passing in your API access token and the name and version number of your image (which can be any set of lowercase alphanumeric characters separated by a colon). For example, for an acmecorp LUSID domain:

    curl -X POST "https://acmecorp.lusid.com/scheduler2/api/images"
       -H "Authorization: Bearer <your-api-access-token>"
       -H "Content-Type: application/json-patch+json"
       -d "{'imageName':'lusid-upsert-transactions-image:0.0.1'}"
    

    The response contains a list of commands (note the AWS login token has been obfuscated):

    {
      "dockerLoginCommand": "docker login -u AWS -p <aws-login-token>",
      "buildVersionedDockerImageCommand": "docker build -t lusid-upsert-transactions-image:0.0.1 .",
      "tagVersionedDockerImageCommand": "docker tag lusid-upsert-transactions-image:0.0.1 acmecorp.lusid.com/acmecorp/lusid-upsert-transactions-image:0.0.1",
      "pushVersionedDockerImageCommand": "docker push acmecorp.lusid.com/acmecorp/lusid-upsert-transactions-image:0.0.1",
      "tagLatestDockerImageCommand": "docker tag lusid-upsert-transactions-image:0.0.1 acmecorp.lusid.com/acmecorp/lusid-upsert-transactions-image:latest",
      "pushLatestDockerImageCommand": "docker push acmecorp.lusid.com/acmecorp/lusid-upsert-transactions-image:latest",
      "expiryTime": "2021-09-06T22:11:48.5050000+00:00"
    }
  3. Execute the first 6 commands sequentially in a Terminal window (as per the expiryTime, note you have 11 hours in which to do so). For example, for the response above you would run the following commands in order:

    $ docker login -u AWS -p <aws-login-token>
    $ docker build -t lusid-upsert-transactions-image:0.0.1 .
    $ docker tag lusid-upsert-transactions-image:0.0.1 acmecorp.lusid.com/acmecorp/lusid-upsert-transactions-image:0.0.1
    $ docker push acmecorp.lusid.com/acmecorp/lusid-upsert-transactions-image:0.0.1
    $ docker tag lusid-upsert-transactions-image:0.0.1 acmecorp.lusid.com/acmecorp/lusid-upsert-transactions-image:latest
    $ docker push acmecorp.lusid.com/acmecorp/lusid-upsert-transactions-image:latest

Using the LUSID web app

For example, to upload the lusid-upsert-transactions-image created in Step 1 of this tutorial:

  1. Sign in to the LUSID web app using the credentials of a LUSID administrator.

  2. From the left-hand menu, select Jobs & Scheduling > Images:
     

  3. On the Images dashboard, click the Upload new image button.

  4. Enter your Docker image Name and Tag (version number), and click the Produce command lines button (note that Docker image names must not contain uppercase characters):
     

  5. Execute the commands sequentially in a Terminal window (note you have 11 hours in which to do so before these commands expire). For example, for an acmecorp LUSID domain:

    $ docker login -u AWS -p <aws-login-token>
    $ docker build -t lusid-upsert-transactions-image:0.0.1 .
    $ docker tag lusid-upsert-transactions-image:0.0.1 acmecorp.lusid.com/acmecorp/lusid-upsert-transactions-image:0.0.1
    $ docker push acmecorp.lusid.com/acmecorp/lusid-upsert-transactions-image:0.0.1
    $ docker tag lusid-upsert-transactions-image:0.0.1 acmecorp.lusid.com/acmecorp/lusid-upsert-transactions-image:latest
    $ docker push acmecorp.lusid.com/acmecorp/lusid-upsert-transactions-image:latest