Skip to content

Commit

Permalink
Merge pull request #121 from at88mph/registry-auth-docs
Browse files Browse the repository at this point in the history
docs: update for new registry authentication
  • Loading branch information
brianmajor authored Nov 7, 2024
2 parents cc49f0a + bb627a6 commit 518adfe
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
Binary file added docs/complete/cli-secret-field.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 28 additions & 5 deletions docs/complete/headless.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,34 @@ For the full details of the job launching API, see this section of the akaha API

All jobs will be run as the calling user. All jobs have the `/arc` filesystem mounted.

Example: launch a headless job, overriding the command and providing two arguments:

```curl -E ~/.ssl/cadcproxy.pem https://ws-uv.canfar.net/skaha/v0/session -d "name=headless-test" -d "image=images.canfar.net/skaha/terminal:1.1.2" --data-urlencode "cmd=touch" --data-urlencode "args=/arc/home/majorb/headless-test-1a /arc/home/majorb/headless-test-1b"```

skaha will return the `sessionID` on a successful post (job launch). The job will remain in the system for 1 hour after completion (success or failure).
##### With a publically available Image
Example: overriding the command and providing two arguments:

```sh
curl -E ~/.ssl/cadcproxy.pem https://ws-uv.canfar.net/skaha/v0/session -d "name=headless-test" -d "image=images.canfar.net/skaha/terminal:1.1.2" --data-urlencode "cmd=touch" --data-urlencode "args=/arc/home/majorb/headless-test-1a /arc/home/majorb/headless-test-1b"
```

##### With a private Image
Example: overriding the command and providing two arguments:

1. Obtain your Image Registry secret.
1. Login to the [Harbor Image Registry](https://images.canfar.net)
1. In the top right, click on your Username, then click on `User Profile`.
1. At the bottom of the `User Profile` modal dialog, there is a `CLI secret` field. Click on the `Copy` icon to copy your secret into the clipboard.
<img src="./cli-secret-field.png" alt="CLI Secret field" />
1. With the CLI secret in your clipboard, create a string with your username and secret, separated by a colon (`:`), and Base64 Encode it:
```sh
ENCODED_HEADER=`echo -n "myusername:my-secret" | base64 -i -`
```
1. Now use that in the session create command:
```sh
curl --header "x-skaha-registry-auth: ${ENCODED_HEADER}" -E ~/.ssl/cadcproxy.pem https://ws-uv.canfar.net/skaha/v0/session -d "name=headless-test" -d "image=images.canfar.net/skaha/terminal:1.1.2" --data-urlencode "cmd=touch" --data-urlencode "args=/arc/home/myusername/headless-test-1a /arc/home/myusername/headless-test-1b"
```

**Note**
The CLI Secret _may_ need to be periodically refreshed from the Harbor page; simply repeat the process from 1.1 above.

On a successful launch from a public or private image, skaha will return the `sessionID` on a post (job launch). The job will remain in the system for 1 hour after completion (success or failure).

Job phases:
- Pending
Expand Down

0 comments on commit 518adfe

Please sign in to comment.