Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions GitLab/custom-executor.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ To do that:

The provided scripts expect the following environment variables to be set:

- `CUSTOM_ENV_ORKA_TOKEN` - User authentication to connect to the Orka environment. Created by running `orka3 user get-token` or `orka3 serviceaccount token <service-account>`.
- `CUSTOM_ENV_ORKA_ENDPOINT` - The Orka endpoint. Usually, it is `http://10.221.188.20`.
- `CUSTOM_ENV_ORKA_CONFIG_NAME` - The name of the VM config to be deployed.
- `CUSTOM_ENV_ORKA_VM_NAME_PREFIX` - The prefix of the generated VM name. Defaults to `gl-runner`.
- `CUSTOM_ENV_ORKA_VM_USER` - User used to SSH to the VM.
- `CUSTOM_ENV_ORKA_SSH_KEY_FILE` - The private SSH key contents to use when connecting to the VM. This key was created earlier during the Orka base image setup.
- `CUSTOM_ENV_VM_DEPLOYMENT_ATTEMPTS` - The number of attempts the executor tries to deploy a VM before it fails. Defaults to `1`. Note - GitLab automatically retries 3 times. This env var allows additional retry attempts.
- `ORKA_TOKEN` - User authentication to connect to the Orka environment. Created by running `orka3 user get-token` or `orka3 serviceaccount token <service-account>`.
- `ORKA_ENDPOINT` - The Orka endpoint. Usually, it is `http://10.221.188.20`.
- `ORKA_CONFIG_NAME` - The name of the VM config to be deployed.
- `ORKA_VM_NAME_PREFIX` - The prefix of the generated VM name. Defaults to `gl-runner`.
- `ORKA_VM_USER` - User used to SSH to the VM. Defaults to `admin`.
- `ORKA_SSH_KEY_FILE` - The private SSH key contents to use when connecting to the VM. This key was created earlier during the Orka base image setup.
- `VM_DEPLOYMENT_ATTEMPTS` - The number of attempts the executor tries to deploy a VM before it fails. Defaults to `1`. Note - GitLab automatically retries 3 times. This env var allows additional retry attempts.

For more information about GitLab CI/CD environment variables, see [here][env-variables].

Expand Down
10 changes: 5 additions & 5 deletions GitLab/scripts/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
BUILD_ID="runner-$CUSTOM_ENV_CI_RUNNER_ID-project-$CUSTOM_ENV_CI_PROJECT_ID-concurrent-$CUSTOM_ENV_CI_CONCURRENT_PROJECT_ID"
export CONNECTION_INFO_ID=$BUILD_ID-connection-info

export ORKA_TOKEN=${CUSTOM_ENV_ORKA_TOKEN:-}
export ORKA_ENDPOINT=${CUSTOM_ENV_ORKA_ENDPOINT:-}
export ORKA_CONFIG_NAME=${CUSTOM_ENV_ORKA_CONFIG_NAME:-}
export ORKA_VM_NAME_PREFIX=${CUSTOM_ENV_ORKA_VM_NAME_PREFIX:-gl-runner}
export ORKA_VM_USER=${CUSTOM_ENV_ORKA_VM_USER:-admin}
export ORKA_TOKEN=${ORKA_TOKEN:-${CUSTOM_ENV_ORKA_TOKEN:-}}
export ORKA_ENDPOINT=${ORKA_ENDPOINT:-${CUSTOM_ENV_ORKA_ENDPOINT:-}}
export ORKA_CONFIG_NAME=${ORKA_CONFIG_NAME:-${CUSTOM_ENV_ORKA_CONFIG_NAME:-}}
export ORKA_VM_NAME_PREFIX=${ORKA_VM_NAME_PREFIX:-${CUSTOM_ENV_ORKA_VM_NAME_PREFIX:-gl-runner}}
export ORKA_VM_USER=${ORKA_VM_USER:-${CUSTOM_ENV_ORKA_VM_USER:-admin}}
ORKA_SSH_KEY_FILE=${CUSTOM_ENV_ORKA_SSH_KEY_FILE:-}

mkdir -p ~/.ssh
Expand Down
2 changes: 1 addition & 1 deletion GitLab/scripts/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ currentDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

source "${currentDir}/base.sh"

VM_DEPLOYMENT_ATTEMPTS=${CUSTOM_ENV_VM_DEPLOYMENT_ATTEMPTS:-1}
VM_DEPLOYMENT_ATTEMPTS=${VM_DEPLOYMENT_ATTEMPTS:-${CUSTOM_ENV_VM_DEPLOYMENT_ATTEMPTS:-1}}

function cleanup_on_failure {
if [ -f "$BUILD_ID" ]; then
Expand Down