Skip to content

Create instance

Create instance #90

name: Create instance
on:
workflow_dispatch:
inputs:
modelName:
description: 'The model to use'
required: true
default: 'llama3.1'
instanceNameSuffix:
description: 'Instance name suffix'
required: false
default: ''
ovhInstanceFlavorName:
description: 'OVH GPU instance flavor name'
required: true
default: 'l4-180'
ovhInstanceImageName:
description: 'OVH instance image name'
required: true
default: 'NVIDIA GPU Cloud (NGC)'
ovhInstanceRegion:
description: 'OVH instance region'
required: true
default: 'GRA11'
serviceReplicas:
description: 'Replicas (number of gpu by default)'
required: false
default: ''
gpuByReplica:
description: 'GPU by replica (leave empty to use all gpu by replica)'
required: false
default: '1'
jobs:
create-instance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install
- name: Get OVH IDs
id: get_ovh_ids
run: poetry run python get_ovh_ids.py
env:
OVH_ENDPOINT: ${{ vars.OVH_ENDPOINT }}
OVH_INSTANCE_FLAVOR_NAME: ${{ inputs.ovhInstanceFlavorName }}
OVH_INSTANCE_IMAGE_NAME: ${{ inputs.ovhInstanceImageName }}
OVH_REGION: ${{ inputs.ovhInstanceRegion }}
OVH_APPLICATION_KEY: ${{ secrets.OVH_APPLICATION_KEY }}
OVH_APPLICATION_SECRET: ${{ secrets.OVH_APPLICATION_SECRET }}
OVH_CONSUMER_KEY: ${{ secrets.OVH_CONSUMER_KEY }}
OVH_SERVICE_NAME: ${{ secrets.OVH_SERVICE_NAME }}
- name: Create instance
run: poetry run python main.py create
env:
OVH_ENDPOINT: ${{ vars.OVH_ENDPOINT }}
OVH_INSTANCE_FLAVOR_ID: ${{ steps.get_ovh_ids.outputs.OVH_INSTANCE_FLAVOR_ID }}
OVH_INSTANCE_IMAGE_ID: ${{ steps.get_ovh_ids.outputs.OVH_INSTANCE_IMAGE_ID }}
OVH_REGION: ${{ inputs.ovhInstanceRegion }}
USERS: ${{ vars.USERS }}
OVH_APPLICATION_KEY: ${{ secrets.OVH_APPLICATION_KEY }}
OVH_APPLICATION_SECRET: ${{ secrets.OVH_APPLICATION_SECRET }}
OVH_CONSUMER_KEY: ${{ secrets.OVH_CONSUMER_KEY }}
OVH_SSH_KEY_ID: ${{ secrets.OVH_SSH_KEY_ID }}
OVH_SERVICE_NAME: ${{ secrets.OVH_SERVICE_NAME }}
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
INSTANCE_NAME_SUFFIX: ${{ inputs.instanceNameSuffix }}
MODEL_NAME: ${{ inputs.modelName }}
SERVICE_REPLICAS: ${{ inputs.serviceReplicas }}
GPU_BY_REPLICA: ${{ inputs.gpuByReplica }}