-
Notifications
You must be signed in to change notification settings - Fork 16
122 lines (117 loc) · 3.77 KB
/
common-docker-big-instance.yml
File metadata and controls
122 lines (117 loc) · 3.77 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: common-docker-big-instance
on:
workflow_call:
inputs:
ref:
type: string
required: false
default: ""
working-directory:
type: string
required: true
docker-context:
type: string
required: false
default: "."
push_image:
type: boolean
required: false
default: true
image-name:
type: string
required: true
docker-file:
type: string
default: "Dockerfile"
required: false
app-cache-dir:
type: string
required: true
secrets:
SLAB_ACTION_TOKEN:
required: true
SLAB_BASE_URL:
required: true
JOB_SECRET:
required: true
BLOCKCHAIN_ACTIONS_TOKEN:
required: true
AWS_ACCESS_KEY_S3_USER:
required: true
AWS_SECRET_KEY_S3_USER:
required: true
CGR_USERNAME:
required: true
CGR_PASSWORD:
required: true
outputs:
image_name:
description: "Image Name with Tag generated by this task"
value: "${{ jobs.run-docker.outputs.image_name }}"
image_tag:
description: "Image Tag generated by this task"
value: "${{ jobs.run-docker.outputs.image_tag }}"
env:
CARGO_TERM_COLOR: always
permissions: {}
jobs:
start-amd64-runner:
name: common-docker-big-instance/start-amd64-runner
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-ec2-runner-amd64.outputs.label }}
steps:
- name: Start EC2 runner AMD64
id: start-ec2-runner-amd64
uses: zama-ai/slab-github-runner@5aee5d157f4a0201e5eaefc9cc648e5f9f5472a5 # v1.6.0
with:
mode: start
github-token: ${{ secrets.SLAB_ACTION_TOKEN }}
slab-url: ${{ secrets.SLAB_BASE_URL }}
job-secret: ${{ secrets.JOB_SECRET }}
backend: aws
profile: docker-big-instance
run-docker:
name: common-docker-big-instance/run-docker
permissions:
contents: read # Required to checkout repository code
packages: write # Required to publish packages
actions: read # Required to read workflow run information
attestations: write # Required to write attestations
id-token: write # Required for OIDC token generation
needs: [start-amd64-runner]
uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@3cf4c2b133947d29e7a313555638621f9ca0345c # v1.0.3
secrets:
BLOCKCHAIN_ACTIONS_TOKEN: ${{ secrets.BLOCKCHAIN_ACTIONS_TOKEN }}
AWS_ACCESS_KEY_S3_USER: ${{ secrets.AWS_ACCESS_KEY_S3_USER }}
AWS_SECRET_KEY_S3_USER: ${{ secrets.AWS_SECRET_KEY_S3_USER }}
CGR_USERNAME: ${{ secrets.CGR_USERNAME }}
CGR_PASSWORD: ${{ secrets.CGR_PASSWORD }}
with:
ref: ${{ inputs.ref }}
docker-context: ${{ inputs.docker-context }}
working-directory: ${{ inputs.working-directory }}
push_image: ${{ inputs.push_image }}
runs-on-amd: ${{ needs.start-amd64-runner.outputs.label }}
runs-on-arm: "large_ubuntu_16_arm"
image-name: ${{ inputs.image-name }}
docker-file: ${{ inputs.docker-file }}
app-cache-dir: ${{ inputs.app-cache-dir }}
use-cgr-secrets: true
rust-toolchain-file-path: rust-toolchain.toml
stop-runners:
name: common-docker-big-instance/stop-runners
needs:
- start-amd64-runner
- run-docker
runs-on: ubuntu-latest
if: always()
steps:
- name: Stop AMD64 runner
uses: zama-ai/slab-github-runner@5aee5d157f4a0201e5eaefc9cc648e5f9f5472a5 # v1.6.0
with:
mode: stop
github-token: ${{ secrets.SLAB_ACTION_TOKEN }}
slab-url: ${{ secrets.SLAB_BASE_URL }}
job-secret: ${{ secrets.JOB_SECRET }}
label: ${{ needs.start-amd64-runner.outputs.label }}