Skip to content

Commit d9d0a04

Browse files
Docker build in GitLab (#68)
* Update .gitlab-ci.yml * Update .gitlab-ci.yml * Update .gitlab-ci.yml * Update file README.md * [pre-commit.ci] auto fixes from pre-commit hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent c4dcba8 commit d9d0a04

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

.gitlab-ci.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
build:
2-
stage: build
3-
image:
4-
name: gitlab-registry.cern.ch/ci-tools/docker-image-builder
5-
entrypoint: [""]
1+
image: gcr.io/kaniko-project/executor:debug
2+
3+
stages:
4+
- build-and-push
5+
6+
build-and-push-job:
7+
stage: build-and-push
68
script:
7-
- mkdir -p /kaniko/.docker
89
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
9-
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/docker/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
10+
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/docker/Dockerfile --destination $CI_REGISTRY_IMAGE/hls4ml-0.8.0:${CI_COMMIT_SHA:0:8} --destination $CI_REGISTRY_IMAGE/hls4ml-0.8.0:latest
11+
12+
build-and-push-vivado-job:
13+
stage: build-and-push
14+
script:
15+
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
16+
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/docker/Dockerfile.vivado --destination $CI_REGISTRY_IMAGE/hls4ml-0.8.0-vivado-2019.1:${CI_COMMIT_SHA:0:8} --destination $CI_REGISTRY_IMAGE/hls4ml-0.8.0-vivado-2019.1:latest

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ conda activate hls4ml-tutorial
2323
## Docker without Vivado
2424
Pull the prebuilt image from the GitHub Container Registry:
2525
```bash
26-
docker pull ghcr.io/fastmachinelearning/hls4ml-tutorial/hls4ml-0.7.1:latest
26+
docker pull ghcr.io/fastmachinelearning/hls4ml-tutorial/hls4ml-0.8.0:latest
2727
```
2828

2929
Follow these steps to build a Docker image that can be used locally, or on a JupyterHub instance.
@@ -35,28 +35,28 @@ Alternatively, you can clone the repository and build locally:
3535
```bash
3636
git clone https://github.com/fastmachinelearning/hls4ml-tutorial
3737
cd hls4ml-tutorial
38-
docker build -f docker/Dockerfile -t ghcr.io/fastmachinelearning/hls4ml-tutorial/hls4ml-0.7.1:latest .
38+
docker build -f docker/Dockerfile -t ghcr.io/fastmachinelearning/hls4ml-tutorial/hls4ml-0.8.0:latest .
3939
```
4040
Then to start the container:
4141
```bash
42-
docker run -p 8888:8888 ghcr.io/fastmachinelearning/hls4ml-tutorial/hls4ml-0.7.1:latest
42+
docker run -p 8888:8888 ghcr.io/fastmachinelearning/hls4ml-tutorial/hls4ml-0.8.0:latest
4343
```
4444
When the container starts, the Jupyter notebook server is started, and the link to open it in your browser is printed.
4545
You can clone the repository inside the container and run the notebooks.
4646

4747
## Docker with Vivado
4848
Pull the prebuilt image from the GitHub Container Registry:
4949
```bash
50-
docker pull ghcr.io/fastmachinelearning/hls4ml-tutorial/hls4ml-0.7.1-vivado-2019.2:latest
50+
docker pull ghcr.io/fastmachinelearning/hls4ml-tutorial/hls4ml-0.8.0-vivado-2019.2:latest
5151
```
5252

5353
To build the image with Vivado, run (Warning: takes a long time and requires a lot of disk space):
5454
```bash
55-
docker build -f docker/Dockerfile.vivado -t ghcr.io/fastmachinelearning/hls4ml-tutorial/hls4ml-0.7.1-vivado-2019.2:latest .
55+
docker build -f docker/Dockerfile.vivado -t ghcr.io/fastmachinelearning/hls4ml-tutorial/hls4ml-0.8.0-vivado-2019.2:latest .
5656
```
5757
Then to start the container:
5858
```bash
59-
docker run -p 8888:8888 ghcr.io/fastmachinelearning/hls4ml-tutorial/hls4ml-0.7.1-vivado-2019.2:latest
59+
docker run -p 8888:8888 ghcr.io/fastmachinelearning/hls4ml-tutorial/hls4ml-0.8.0-vivado-2019.2:latest
6060
```
6161

6262
## Companion material

0 commit comments

Comments
 (0)