You can create a job to execute a particular Docker image on demand, for example an image containing a Python script to upsert transactions into LUSID from a CSV file.
You can optionally then create a schedule to automatically trigger the job at chosen times.
To start the process of creating a new job:
- Sign into the LUSID web app and select Workflows & Scheduling > Jobs from the left-hand menu:
- On the Jobs dashboard, click the Create job button (top right).
- Specify a Scope and Code that together uniquely identify the job in your LUSID domain.
- If not already done, follow these instructions to upload your Docker image to the FINBOURNE AWS store. Upon returning to this screen, you should be able to select your image from the
- On the Arguments screen, you can (optionally) define command line arguments to pass in to your job at runtime. In our example, we’ll add two arguments, passing in for each argument:
Name, prefixed with
Data typefrom the dropdown provided and a
- Whether or not the argument is
Mandatory. In our example, both should be mandatory, since transactions must upsert to a transaction portfolio.
Defaultvalue (which can be overridden by a user at runtime).
- On the Arguments screen, you can (optionally) define environment variables to pass in to your job at runtime. In our example, since we're exercising the LUSID API via the LUSID Python SDK, we'll use this facility to pass in credentials, so the SDK can obtain an API access token. We need to define the following environment variables:
Variable name Source of the value Data type Example value
LUSID account username
Client ID of the application
LUSID domain URL
Dedicated Okta token URL for LUSID domain
Account passwords and client secrets must be pulled in from the Configuration Store. See how to upload these credentials to the Configuration Store. Upon returning to this screen, select
Configurationfrom the Data type dropdown and click in the Default value key area to be guided to select the appropriate configuration set and item (the
config://...syntax is automatically generated).
- For now, the Resources tab can be safely skipped. Click Save to finish creating the job.
Once the job is created, you can trigger the job on demand by selecting Run now. See how to monitor job runs and troubleshoot any failures.
You can also create a schedule which triggers the job to run on a particular schedule with particular arguments. See how to do this.