You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pipeline and code version are manually added. From Jake V (Code Ocean):
Code and pipeline versions are manually entered in the processing json. The code version is never truly up to date. Jake has posted a way to get around this with the following steps:
Here are a few code snippets that may be helpful to track what capsule commits are used by your pipeline. They assume you have jq installed and have your Code Ocean API token attached as a custom key secret.
At runtime every capsule will have its capsule ID as the environment variable CO_CAPSULE_ID. You can use the Code Ocean API to get the capsule's metadata:
If it's a release capsule, one of the fields of the API response is versions which you can use to document what capsule version is used in your pipeline, e.g. echo $get_capsule_metadata | jq -r '.versions' >> ../results/processing.json
If it's not a release version but your capsule is backed by a GitHub repo, one of the fields in the API response is cloned_from_url which is your GitHub repo's URL. Then you can use the GitHub API to get the info on the latest commit, e.g. latest_commit=$(curl -s https://api.github.com/repos/AllenNeuralDynamics//commits | jq -r '.[0] | {sha: .sha, author: .commit.author.name, date: .commit.author.date, message: .commit.message}')
The pipeline version can be pulled using the CO API.
The text was updated successfully, but these errors were encountered:
Pipeline and code version are manually added. From Jake V (Code Ocean):
Code and pipeline versions are manually entered in the processing json. The code version is never truly up to date. Jake has posted a way to get around this with the following steps:
Here are a few code snippets that may be helpful to track what capsule commits are used by your pipeline. They assume you have jq installed and have your Code Ocean API token attached as a custom key secret.
At runtime every capsule will have its capsule ID as the environment variable CO_CAPSULE_ID. You can use the Code Ocean API to get the capsule's metadata:
get_capsule_metadata=$(curl -s -H "Content-Type: application/json" -u ${CUSTOM_KEY}: -X GET https://codeocean.allenneuraldynamics.org/api/v1/capsules/${CO_CAPSULE_ID})
If it's a release capsule, one of the fields of the API response is versions which you can use to document what capsule version is used in your pipeline, e.g. echo $get_capsule_metadata | jq -r '.versions' >> ../results/processing.json
If it's not a release version but your capsule is backed by a GitHub repo, one of the fields in the API response is cloned_from_url which is your GitHub repo's URL. Then you can use the GitHub API to get the info on the latest commit, e.g. latest_commit=$(curl -s https://api.github.com/repos/AllenNeuralDynamics//commits | jq -r '.[0] | {sha: .sha, author: .commit.author.name, date: .commit.author.date, message: .commit.message}')
The pipeline version can be pulled using the CO API.
The text was updated successfully, but these errors were encountered: