-
Notifications
You must be signed in to change notification settings - Fork 68
65 lines (61 loc) · 2.19 KB
/
nightly-docker-ecr-sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Sync docker and ECR repo
on:
workflow_dispatch:
inputs:
mode:
description: 'version string like 0.27.0, default is nightly'
required: true
default: 'nightly'
schedule:
- cron: '0 14 * * *'
jobs:
create-aarch64-runner:
runs-on: [ self-hosted, scheduler ]
steps:
- name: Create new Graviton instance
id: create_aarch64
run: |
cd /home/ubuntu/djl_benchmark_script/scripts
token=$( curl -X POST -H "Authorization: token ${{ secrets.ACTION_RUNNER_PERSONAL_TOKEN }}" \
https://api.github.com/repos/deepjavalibrary/djl-serving/actions/runners/registration-token \
--fail \
| jq '.token' | tr -d '"' )
./start_instance.sh action_graviton $token djl-serving
outputs:
aarch64_instance_id: ${{ steps.create_aarch64.outputs.action_graviton_instance_id }}
nightly-aarch64:
runs-on: [ self-hosted, aarch64 ]
timeout-minutes: 60
needs: create-aarch64-runner
steps:
- uses: actions/checkout@v4
- name: Clean docker env
working-directory: serving/docker
run: |
yes | docker system prune -a --volumes
- name: install awscli
run: |
sudo apt-get update
sudo apt-get install awscli -y
- name: Pull and sync nightly docker image
working-directory: serving/docker
run: |
version=${{ github.event.inputs.mode }}
[ -z "$version" ] && version="nightly"
repo="125045733377.dkr.ecr.us-east-1.amazonaws.com"
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $repo
./scripts/pull_and_retag.sh $version $repo
- name: Clean docker env
working-directory: serving/docker
run: |
yes | docker system prune -a --volumes
stop-aarch64-runner:
if: always()
runs-on: [ self-hosted, scheduler ]
needs: [nightly-aarch64, create-aarch64-runner]
steps:
- name: Stop all instances
run: |
cd /home/ubuntu/djl_benchmark_script/scripts
instance_id=${{ needs.create-aarch64-runner.outputs.aarch64_instance_id }}
./stop_instance.sh $instance_id