-
Notifications
You must be signed in to change notification settings - Fork 0
/
valohai.yaml
140 lines (116 loc) · 5.2 KB
/
valohai.yaml
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
- step:
name: docker-image-dockerhub
image: docker:dind
command:
- apk add --no-cache python3 py3-pip
- python ./dockerimagebuilder/writedockerfile.py {parameters}
- dockerd &
- export DOCKERTAG={parameter-value:docker-tag}
- test -f "/valohai/repository/Dockerfile" &&
{ docker build -t $DOCKERTAG -f /valohai/repository/Dockerfile --progress=plain . ;
docker login -u $DHUSERNAME -p $DHPASSWORD;
docker push $DOCKERTAG; }
inputs:
- name: dockerfileinput
optional: true
parameters:
- name: docker-tag
optional: true
description: "Defines the image tag when building and pushing the image: <USERNAME>/<REPOSITORY>:<TAG>. Note that if there is already an image with the same tag, the old image will be removed."
- name: repository
type: string
description: "Required for docker login in AWS and GCP. Leave empty for Docker Hub."
- name: region
type: string
description: "AWS region, leave empty for Docker Hub and GCP."
- name: dockerfile
default: "# Our base image
FROM python:3.9
# Copy the requirements.txt file to our Docker image
ADD ./dockerimagebuilder/requirements.txt .
# Install the requirements.txt
RUN pip install -r requirements.txt"
type: string
optional: true
description: You can use this parameter to provide the Dockerfile contents instead of giving it as an input.
widget: dockerfile
- step:
name: docker-image-gcp
image: docker:dind
command:
- apk add --no-cache python3 py3-pip
- python ./dockerimagebuilder/writedockerfile.py {parameters}
- dockerd &
- export DOCKERTAG={parameter-value:docker-tag} &&
export REPOSITORY={parameter-value:repository}
- test -f "/valohai/repository/Dockerfile" &&
{ docker build -t $DOCKERTAG -f /valohai/repository/Dockerfile --progress=plain . ;
echo $GCPKEY | docker login -u _json_key --password-stdin $REPOSITORY;
docker push $DOCKERTAG; }
inputs:
- name: dockerfileinput
optional: true
parameters:
- name: docker-tag
description: "Tag that is used when pushing the image to the registry: <REGION>-docker.pkg.dev/<PROJECT_ID>/<REPOSITORY>/<IMAGE>:<TAG>. Note that if there is already an image with the same tag, the tag will be removed and assigned to the new image."
- name: repository
type: string
description: "Required for docker login in AWS and GCP: https://<REGION>-docker.pkg.dev"
- name: region
type: string
optional: true
description: "AWS region, leave empty for Docker Hub and GCP."
- name: dockerfile
default: "# Our base image
FROM python:3.9
# Copy the requirements.txt file to our Docker image
ADD ./dockerimagebuilder/requirements.txt .
# Install the requirements.txt
RUN pip install -r requirements.txt"
type: string
optional: true
description: You can use this parameter to provide the Dockerfile contents instead of giving it as an input.
widget: dockerfile
- step:
name: docker-image-aws
image: docker:dind
command:
- apk add --no-cache python3 py3-pip aws-cli
- python ./dockerimagebuilder/writedockerfile.py {parameters}
- dockerd &
- export DOCKERTAG={parameter-value:docker-tag} &&
export REPOSITORY={parameter-value:repository} &&
export REGION={parameter-value:region}
- test -f "/valohai/repository/Dockerfile" &&
{ docker build -t $DOCKERTAG -f /valohai/repository/Dockerfile --progress=plain . ;
aws ecr get-login-password --region $REGION | docker login --username AWS --password-stdin $REPOSITORY;
docker push $DOCKERTAG; }
inputs:
- name: dockerfileinput
optional: true
parameters:
- name: docker-tag
type: string
description: "Tag that is used when pushing the image to the registry: <AWS_ACCOUNT_ID>.dkr.ecr.<REGION>.amazonaws.com/<REPOSITORY>:<TAG>. Note that if there is already an image with the same tag, the tag will be removed and assigned to the new image."
- name: repository
type: string
description: "Required for docker login in AWS and GCP: <AWS_ACCOUNT_ID>.dkr.ecr.<REGION>.amazonaws.com/<REPOSITORY>"
- name: region
type: string
description: "Provide the AWS region, e.g. eu-west-1."
- name: dockerfile
default: "# Our base image
FROM python:3.9
# Copy the requirements.txt file to our Docker image
ADD ./dockerimagebuilder/requirements.txt .
# Install the requirements.txt
RUN pip install -r requirements.txt"
type: string
optional: true
description: You can use this parameter to provide the Dockerfile contents instead of giving it as an input.
widget: dockerfile
- step:
name: library-debug-test
image: python:3.9
command:
- echo "testing"