Skip to content

Cloud Integration

When operating within a docker container, interactions are permitted with the following cloud provider storage solutions:

  1. AWS S3 Buckets
  2. Azure Blob Storage

Interactions with these vendors are facilitated using REST calls.

From a users perspective, this is intended to be a very lightweight API with users requiring minimal configuration to publish to a registry on-prem or within a cloud storage solution.

Prior to running any of the function calls to publish or retrieve information from the cloud, a user must generate a storage bucket to which artefacts will be published. At present, this must be done externally to the functionality provided by this interface i.e. if the bucket does not exist, we will not generate it.

Once the user has a storage bucket available, they can make use of the following examples from any application running with this library.

The following sections outline how users can initialise the functionality and make example function calls in the context of a cloud vendor solution.

Required environment variables

Interactions with the various cloud vendors require the definition of environment variables to authenticate REST calls to the vendors. The following outlines the required arguments for each of the supported vendors within the docker image used.

Vendor Environment variable


This library provides 2 methods to create/access a registry within the cloud:

  1. Command line definition
  2. Within a q process

Command line definition

For users which only require access to a single registry, the relevant bucket/blob can be specified on initialisation of the library as detailed below:

  • AWS

    $ source qpbuild/.env
    $ docker run -it -p 5000:5000 \
      -e "KDB_LICENSE_B64=$KDB_LICENSE_B64" \
      -e "AWS_REGION=$AWS_REGION" \ -aws s3://path-to-bucket -p 5000

  • Azure

    $ source qpbuild/.env
    $ docker run -it -p 5000:5000 \
      -e "KDB_LICENSE_B64=$KDB_LICENSE_B64" \
      -e "AZURE_STORAGE_SHARED_KEY=$AZURE_STORAGE_SHARED_KEY" \ -azure ms://path-to-bucket -p 5000

Within a q process

For one-off calls to multiple registries, users can alter their chosen registry within their q process. To do so, they must pass in a dictionary containing the vendor type and location to their desired function as the folderPath argument. Alternatively, users can change the default location .ml.registry.location to their desired location in dictionary format.

The following startup for a docker image would facilitate publishing both to AWS, Azure and interactions with a registry mounted between the /tmp directory within the container and $(pwd)

$ source qpbuild/.env
$ docker run -it -p 5000:5000 \
  -v "$(pwd)":/tmp \ -p 5000


Example 1: Creating new registries with each of the above mentioned methods.

// Adding a new registry to the "/tmp" directory and mounted directory["/tmp";::]

// Registry location dictionary

// Once off call to cloud registry

// Change default registry location

Example 2: Adding items to cloud storage.


Example 3: Log ancillary information associated with a model.

q).ml.registry.set.parameters[::;::;"mymodel";1 0;"paramFile";`param1`param2!1 2]

Example 4: Retrieve items from the registry.

q).ml.registry.get.model[::;::;"mymodel";1 0]
modelInfo| `registry`model`monitoring!(`description`modelInformation`experime..
model    | {x}
timestamp                     metricName metricValue
2021.04.29D12:24:23.117795000 metric     2
param1| 1
param2| 2

Example 4: Delete the registry.