What artifacts are pushed to Openlayer
To use Openlayer’s development mode, you must push a tarfile with a directory that adheres to the following structure, where openlayer.json is a configuration file:
openlayer.json
, there is a run script (openlayer_run.py
).
This option represents the scenario where Openlayer will use your script to get your model
outputs for your datasets.
On the other hand, option 2 illustrates the situation when
you already provide your model’s outputs for your datasets. Refer to the Configuring
output generation page for details.
Option 1 is more common. However, option 2 is suitable for users who don’t
want to give Openlayer access to their source code and for users whose
execution runtime is not supported by Openlayer.
Pushing to Openlayer
To push the tarfile just created to Openlayer using the REST API, you must:1
Retrieve a presigned URL
Make a POST request to
/storage/presigned-url to
retrieve a presigned URL. Ensure that the
objectName
query parameter has
the name of the tarfile created.2
Upload tarfile to the retrieved URL
Make a POST request to the
url
received in the response to the previous
request with a file upload pointing to the tarfile. No authentication is
needed for this request.3
Create a project version
Make a POST request to
/projects/{id}/versions
to create a new project version (commit) associated with the tarfile
uploaded. In the request body, include a commit message and the
storageUri
from
the first request.
You will get the commit id as part of the response. You can use this id
to poll
the commit status, as discussed in the next section.Poll the results
After following the steps above, you should see a new commit in your Openlayer project. You can poll the results using the REST API. To do so, make a GET request to /projects/{projectId}/versions. In the response, you can check thestatus
field to see if it is:
running
completed
failed
queued
paused
unknown
queued
.
Shortly after, it goes to running
, and once it is completed
, you’ll receive
the passingGoalCount
, and failingGoalCount
— which are the number of tests passing,
and failing, respectively.
If the push fails (status failed
), you can check the logs on the Openlayer platform to debug the issue.