77 description : ' release/nightly/temp, default is nightly'
88 required : true
99 default : ' nightly'
10+ workflow_call :
11+ inputs :
12+ mode :
13+ description : ' release/nightly/temp, default is nightly'
14+ type : string
15+ required : true
16+ default : ' nightly'
1017 schedule :
1118 - cron : ' 0 13 * * *'
1219
2936 $AGENT_TOOLSDIRECTORY
3037 - uses : actions/checkout@v4
3138 - name : Login to Docker
32- uses : docker/login-action@v2
39+ uses : docker/login-action@v3
3340 with :
3441 username : ${{ secrets.DOCKER_USERNAME }}
3542 password : ${{ secrets.DOCKER_PASSWORD }}
@@ -52,43 +59,43 @@ jobs:
5259 path : ~/.gradle/caches
5360 key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
5461 - name : Build serving package for nightly
55- if : ${{ github.event. inputs.mode == '' || github.event. inputs.mode == 'nightly' }}
62+ if : ${{ inputs.mode == '' || inputs.mode == 'nightly' }}
5663 run : |
5764 ./gradlew --refresh-dependencies :serving:dockerDeb -Psnapshot
5865 - name : Build and push nightly docker image
59- if : ${{ github.event. inputs.mode == '' || github.event. inputs.mode == 'nightly' }}
66+ if : ${{ inputs.mode == '' || inputs.mode == 'nightly' }}
6067 working-directory : serving/docker
6168 run : |
62- DJL_VERSION=$(cat ../../gradle.properties | awk -F '=' '/djl_version / {print $2}')
69+ DJL_VERSION=$(awk -F '=' '/djl / {gsub(/ ?"/, "", $2); print $2}' ../../gradle/libs.versions.toml )
6370 export NIGHTLY="-nightly"
64- docker compose build --no-cache --build-arg djl_version=${DJL_VERSION}~ SNAPSHOT ${{ matrix.arch }}
71+ docker compose build --no-cache --build-arg djl_version=${DJL_VERSION}- SNAPSHOT ${{ matrix.arch }}
6572 docker compose push ${{ matrix.arch }}
6673 - name : Build and push temp image
67- if : ${{ github.event. inputs.mode == 'temp' }}
74+ if : ${{ inputs.mode == 'temp' }}
6875 working-directory : serving/docker
6976 run : |
70- DJL_VERSION=$(cat ../../gradle.properties | awk -F '=' '/djl_version / {print $2}')
77+ DJL_VERSION=$(awk -F '=' '/djl / {gsub(/ ?"/, "", $2); print $2}' ../../gradle/libs.versions.toml )
7178 export NIGHTLY="-nightly"
72- docker compose build --no-cache --build-arg djl_version=${DJL_VERSION}~ SNAPSHOT ${{ matrix.arch }}
79+ docker compose build --no-cache --build-arg djl_version=${DJL_VERSION}- SNAPSHOT ${{ matrix.arch }}
7380 repo="185921645874.dkr.ecr.us-east-1.amazonaws.com/djl-ci-temp"
7481 aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $repo
7582 tempTag="$repo:${{ matrix.arch }}-${GITHUB_SHA}"
7683 docker tag deepjavalibrary/djl-serving:${{ matrix.arch }}-nightly $tempTag
7784 docker push $tempTag
7885 - name : Build and push release docker image
79- if : ${{ github.event. inputs.mode == 'release' }}
86+ if : ${{ inputs.mode == 'release' }}
8087 working-directory : serving/docker
8188 run : |
82- DJL_VERSION=$(cat ../../gradle.properties | awk -F '=' '/djl_version / {print $2}')
89+ DJL_VERSION=$(awk -F '=' '/djl / {gsub(/ ?"/, "", $2); print $2}' ../../gradle/libs.versions.toml )
8390 export BASE_RELEASE_VERSION="${DJL_VERSION}"
8491 export RELEASE_VERSION="${DJL_VERSION}-"
8592 docker compose build --no-cache --build-arg djl_version=${DJL_VERSION} ${{ matrix.arch }}
8693 docker compose push ${{ matrix.arch }}
8794 - name : Retag image for release
88- if : ${{ matrix.arch == 'cpu' && github.event. inputs.mode == 'release' }}
95+ if : ${{ matrix.arch == 'cpu' && inputs.mode == 'release' }}
8996 working-directory : serving/docker
9097 run : |
91- DJL_VERSION=$(cat ../../gradle.properties | awk -F '=' '/djl_version / {print $2}')
98+ DJL_VERSION=$(awk -F '=' '/djl / {gsub(/ ?"/, "", $2); print $2}' ../../gradle/libs.versions.toml )
9299 docker tag deepjavalibrary/djl-serving:${DJL_VERSION} deepjavalibrary/djl-serving:latest
93100 docker push deepjavalibrary/djl-serving:latest
94101
@@ -128,7 +135,7 @@ jobs:
128135 run : |
129136 yes | docker system prune -a --volumes
130137 - name : Login to Docker
131- uses : docker/login-action@v2
138+ uses : docker/login-action@v3
132139 with :
133140 username : ${{ secrets.DOCKER_USERNAME }}
134141 password : ${{ secrets.DOCKER_PASSWORD }}
@@ -151,34 +158,34 @@ jobs:
151158 path : ~/.gradle/caches
152159 key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
153160 - name : Build serving package for nightly
154- if : ${{ github.event. inputs.mode == '' || github.event. inputs.mode == 'nightly' }}
161+ if : ${{ inputs.mode == '' || inputs.mode == 'nightly' }}
155162 run : |
156163 ./gradlew --refresh-dependencies :serving:dockerDeb -Psnapshot
157164 - name : Build and push nightly docker image
158- if : ${{ github.event. inputs.mode == '' || github.event. inputs.mode == 'nightly' }}
165+ if : ${{ inputs.mode == '' || inputs.mode == 'nightly' }}
159166 working-directory : serving/docker
160167 run : |
161- DJL_VERSION=$(cat ../../gradle.properties | awk -F '=' '/djl_version / {print $2}')
168+ DJL_VERSION=$(awk -F '=' '/djl / {gsub(/ ?"/, "", $2); print $2}' ../../gradle/libs.versions.toml )
162169 export NIGHTLY="-nightly"
163- docker compose build --no-cache --build-arg djl_version=${DJL_VERSION}~ SNAPSHOT aarch64
170+ docker compose build --no-cache --build-arg djl_version=${DJL_VERSION}- SNAPSHOT aarch64
164171 docker compose push aarch64
165172 - name : Build and push temp image
166- if : ${{ github.event. inputs.mode == 'temp' }}
173+ if : ${{ inputs.mode == 'temp' }}
167174 working-directory : serving/docker
168175 run : |
169- DJL_VERSION=$(cat ../../gradle.properties | awk -F '=' '/djl_version / {print $2}')
176+ DJL_VERSION=$(awk -F '=' '/djl / {gsub(/ ?"/, "", $2); print $2}' ../../gradle/libs.versions.toml )
170177 export NIGHTLY="-nightly"
171- docker compose build --no-cache --build-arg djl_version=${DJL_VERSION}~ SNAPSHOT aarch64
178+ docker compose build --no-cache --build-arg djl_version=${DJL_VERSION}- SNAPSHOT aarch64
172179 repo="185921645874.dkr.ecr.us-east-1.amazonaws.com/djl-ci-temp"
173180 aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $repo
174181 tempTag="$repo:aarch64-${GITHUB_SHA}"
175182 docker tag deepjavalibrary/djl-serving:aarch64-nightly $tempTag
176183 docker push $tempTag
177184 - name : Build and push release docker image
178- if : ${{ github.event. inputs.mode == 'release' }}
185+ if : ${{ inputs.mode == 'release' }}
179186 working-directory : serving/docker
180187 run : |
181- DJL_VERSION=$(cat ../../gradle.properties | awk -F '=' '/djl_version / {print $2}')
188+ DJL_VERSION=$(awk -F '=' '/djl / {gsub(/ ?"/, "", $2); print $2}' ../../gradle/libs.versions.toml )
182189 export BASE_RELEASE_VERSION="${DJL_VERSION}"
183190 export RELEASE_VERSION="${DJL_VERSION}-"
184191 docker compose build --no-cache --build-arg djl_version=${DJL_VERSION} aarch64
@@ -195,7 +202,7 @@ jobs:
195202 run : |
196203 yes | docker system prune -a --volumes
197204 - name : Login to Docker
198- uses : docker/login-action@v2
205+ uses : docker/login-action@v3
199206 with :
200207 username : ${{ secrets.DOCKER_USERNAME }}
201208 password : ${{ secrets.DOCKER_PASSWORD }}
@@ -218,34 +225,34 @@ jobs:
218225 path : ~/.gradle/caches
219226 key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
220227 - name : Build serving package for nightly
221- if : ${{ github.event. inputs.mode == '' || github.event. inputs.mode == 'nightly' }}
228+ if : ${{ inputs.mode == '' || inputs.mode == 'nightly' }}
222229 run : |
223230 ./gradlew --refresh-dependencies :serving:dockerDeb -Psnapshot
224231 - name : Build and push nightly docker image
225- if : ${{ github.event. inputs.mode == '' || github.event. inputs.mode == 'nightly' }}
232+ if : ${{ inputs.mode == '' || inputs.mode == 'nightly' }}
226233 working-directory : serving/docker
227234 run : |
228- DJL_VERSION=$(cat ../../gradle.properties | awk -F '=' '/djl_version / {print $2}')
235+ DJL_VERSION=$(awk -F '=' '/djl / {gsub(/ ?"/, "", $2); print $2}' ../../gradle/libs.versions.toml )
229236 export NIGHTLY="-nightly"
230- docker compose build --no-cache --build-arg djl_version=${DJL_VERSION}~ SNAPSHOT lmi
237+ docker compose build --no-cache --build-arg djl_version=${DJL_VERSION}- SNAPSHOT lmi
231238 docker compose push lmi
232239 - name : Build and push temp image
233- if : ${{ github.event. inputs.mode == 'temp' }}
240+ if : ${{ inputs.mode == 'temp' }}
234241 working-directory : serving/docker
235242 run : |
236- DJL_VERSION=$(cat ../../gradle.properties | awk -F '=' '/djl_version / {print $2}')
243+ DJL_VERSION=$(awk -F '=' '/djl / {gsub(/ ?"/, "", $2); print $2}' ../../gradle/libs.versions.toml )
237244 export NIGHTLY="-nightly"
238- docker compose build --no-cache --build-arg djl_version=${DJL_VERSION}~ SNAPSHOT lmi
245+ docker compose build --no-cache --build-arg djl_version=${DJL_VERSION}- SNAPSHOT lmi
239246 repo="185921645874.dkr.ecr.us-east-1.amazonaws.com/djl-ci-temp"
240247 aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $repo
241248 tempTag="$repo:lmi-$GITHUB_SHA"
242249 docker tag deepjavalibrary/djl-serving:lmi-nightly $tempTag
243250 docker push $tempTag
244251 - name : Build and push release docker image
245- if : ${{ github.event. inputs.mode == 'release' }}
252+ if : ${{ inputs.mode == 'release' }}
246253 working-directory : serving/docker
247254 run : |
248- DJL_VERSION=$(cat ../../gradle.properties | awk -F '=' '/djl_version / {print $2}')
255+ DJL_VERSION=$(awk -F '=' '/djl / {gsub(/ ?"/, "", $2); print $2}' ../../gradle/libs.versions.toml )
249256 export BASE_RELEASE_VERSION="${DJL_VERSION}"
250257 export RELEASE_VERSION="${DJL_VERSION}-"
251258 docker compose build --no-cache --build-arg djl_version=${DJL_VERSION} lmi
0 commit comments