Skip to content
Open
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
77 changes: 77 additions & 0 deletions jenkins/jobs/provision-nomad-whisper-cpu-pool.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
- job:
name: provision-nomad-whisper-cpu-pool
display-name: provision nomad whisper CPU instance pool
description: 'Provision a nomad whisper CPU pool for a new environment/region.'
concurrent: true
parameters:
- string:
name: VIDEO_INFRA_BRANCH
default: main
description: "Controls checkout branch for infra repos, defaults to 'main'."
trim: true
- string:
name: ENVIRONMENT
default: ops-dev
description: "Environment to build in, defaults to 'ops-dev'."
trim: true
- string:
name: POOL_TYPE
default: "whisper-cpu"
description: "Type of pool to build, defaults to 'whisper-cpu'."
trim: true
- string:
name: POOL_PUBLIC
description: "Assign public IP to pool nodes, set to 'true' for public IP, defaults to 'false' in scripts."
trim: true
- string:
name: CLOUD_PROVIDER
default: oracle
description: "Cloud Provider, defaults to 'oracle'"
trim: true
- string:
name: RELEASE_BRANCH
default: main
description: "Name of an existing infra branch to use when creating the release, defaults to 'main'."
trim: true
- string:
name: ORACLE_REGION
description: "Oracle Region to build in"
trim: true
- string:
name: SHAPE
description: "Oracle shape to override the default shape for the pool"
trim: true
- string:
name: OCPUS
description: "CPU count to override the default CPU count for the pool"
trim: true
- string:
name: MEMORY_IN_GBS
description: "MEMORY_IN_GBS to override the default memory for the pool"
trim: true
- string:
name: INFRA_CONFIGURATION_REPO
default: [email protected]:jitsi/infra-configuration.git
description: "Repo for configuration code (ansible etc), defaults to '[email protected]:jitsi/infra-configuration.git'."
trim: true
- string:
name: INFRA_CUSTOMIZATIONS_REPO
default: [email protected]:jitsi/infra-customizations.git
description: "Repo with customized configurations, defaults to '[email protected]:jitsi/infra-customizations.git'."
trim: true

project-type: pipeline
sandbox: true
pipeline-scm:
scm:
- git:
url: [email protected]:jitsi/infra-provisioning.git
credentials-id: "video-infra"
branches:
- "origin/${{VIDEO_INFRA_BRANCH}}"
browser: githubweb
browser-url: https://github.com/jitsi/infra-provisioning
submodule:
recursive: true
script-path: jenkins/groovy/provision-nomad-instance-pool/Jenkinsfile
lightweight-checkout: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -x
unset SSH_USER

[ -z "$POOL_TYPE" ] && export POOL_TYPE="whisper-cpu"
[ -z "$DISK_IN_GBS" ] && export DISK_IN_GBS="50"
# start with only 1 for whisper CPU pools
[ -z "$INSTANCE_POOL_SIZE" ] && export INSTANCE_POOL_SIZE=1
[ -z "$POSTRUNNER_PATH" ] && export POSTRUNNER_PATH="terraform/nomad-instance-pool/user-data/postinstall-runner-whisper-cpu-oracle.sh"

LOCAL_PATH=$(dirname "${BASH_SOURCE[0]}")
$LOCAL_PATH/create-nomad-instance-pool-stack.sh $@
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ fi
[ -z "$POOL_TYPE" ] && POOL_TYPE="skynet"
export HOST_ROLE="gpu"
export GPU_COUNT="$(nvidia-smi --list-gpus | wc -l)"
export ANSIBLE_VARS="hcv_environment=$ENVIRONMENT cloud_name=$CLOUD_NAME cloud_provider=oracle oracle_region=$ORACLE_REGION region=$ORACLE_REGION nomad_pool_type=$POOL_TYPE nomad_gpu_count=$GPU_COUNT nvidia_docker_flag=true"
export ANSIBLE_VARS="hcv_environment=$ENVIRONMENT cloud_name=$CLOUD_NAME cloud_provider=oracle oracle_region=$ORACLE_REGION region=$ORACLE_REGION nomad_pool_type=$POOL_TYPE nomad_gpu_count=$GPU_COUNT nomad_models_flag=true nvidia_docker_flag=true"
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# nomad customizations

# with no overrides, provision based on the variables below using default_provision
# default_provision takes the following variables ANSIBLE_PLAYBOOK, ANSIBLE_VARS and HOST_ROLE (defaults to $SHARD_ROLE)
export ANSIBLE_PLAYBOOK="nomad-client.yml"

. /usr/local/bin/oracle_cache.sh
[ -z "$CACHE_PATH" ] && CACHE_PATH=$(ls /tmp/oracle_cache-*)
export POOL_TYPE_TAG="pool_type"
export POOL_TYPE=$(cat $CACHE_PATH | jq -r --arg POOL_TYPE_TAG "$POOL_TYPE_TAG" ".[\"$POOL_TYPE_TAG\"]")
if [[ "$POOL_TYPE" == "null" ]]; then
export POOL_TYPE=
fi
[ -z "$POOL_TYPE" ] && POOL_TYPE="whisper-cpu"
export HOST_ROLE="whisperc"
export ANSIBLE_VARS="hcv_environment=$ENVIRONMENT cloud_name=$CLOUD_NAME cloud_provider=oracle oracle_region=$ORACLE_REGION region=$ORACLE_REGION nomad_pool_type=$POOL_TYPE nomad_models_flag=true"