Skip to content
Snippets Groups Projects

graph: Fix ARG declaration

Closed Antoine R. Dumont requested to merge mr/fix-graph-declaration into master

Making them top-level, it's somehow shadowed by the from rust image instruction. Which means that the bottom env instructions are currently moot.

For example, SWH_CONFIG_FILENAME is set to /config.yml (should be /etc/swh/config.yml) and the default user is root (should be swh [1000]). This was not intended. [1]

This fixes it [2]

It probably means that we'll need to adapt the datasets currently installed too. (Like I had to do for the provenance, look into the pv declaration to know where it's mounted at in the host machine and chown the dataset to user 1000, that's the 'zack' uid in our infrastructure for legacy reasons ;)

[1] Before

tony@kessel:~/work/inria/repo/swh/sysadm-environment/swh-apps (master) $ app=graph; prefix="swh-"; DOCKER_BUILDKIT=1 docker build -t "${prefix}${app}:latest" "apps/${prefix}${app}" --build-arg REGISTRY= && docker run -it "${prefix}${app}" shell
[+] Building 3.0s (18/18) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                                                           0.0s
 => => transferring dockerfile: 38B                                                                                                                                                                            0.0s
 => [internal] load .dockerignore                                                                                                                                                                              0.0s
 => => transferring context: 2B                                                                                                                                                                                0.0s
 => [internal] load metadata for docker.io/library/base:latest                                                                                                                                                 0.0s
 => [internal] load metadata for docker.io/library/rust:1.85-bookworm                                                                                                                                          0.0s
 => [stage-1 1/8] FROM docker.io/library/base:latest                                                                                                                                                           0.0s
 => [rust_build 1/3] FROM docker.io/library/rust:1.85-bookworm                                                                                                                                                 0.0s
 => [internal] load build context                                                                                                                                                                              0.0s
 => => transferring context: 2.93kB                                                                                                                                                                            0.0s
 => CACHED [internal] settings cache mount permissions                                                                                                                                                         0.0s
 => CACHED [stage-1 2/8] RUN apt-get update &&     apt-get install -y zstd &&     apt-get clean                                                                                                                0.0s
 => CACHED [stage-1 3/8] RUN mkdir -p /srv/graph /srv/dataset                                                                                                                                                  0.0s
 => CACHED [stage-1 4/8] RUN chown ${userid}:${groupid} /srv/graph /srv/dataset                                                                                                                                0.0s
 => CACHED [rust_build 2/3] RUN apt-get update &&     apt-get upgrade -y &&     apt-get install -y build-essential libclang-dev       zstd protobuf-compiler default-jre &&     apt-get clean                  0.0s
 => CACHED [rust_build 3/3] RUN --mount=type=cache,target=.cache,uid=1000,gid=1000   RUSTFLAGS="-C target-cpu=native"   cargo install swh-graph swh-graph-grpc-server                                          0.0s
 => [stage-1 5/8] COPY --chmod=0644 requirements-frozen.txt                                                                                                                                                    0.1s
 => [stage-1 6/8] RUN --mount=type=cache,target=.cache,uid=1000,gid=1000     uv pip sync requirements-frozen.txt                                                                                               1.9s
 => [stage-1 7/8] COPY --from=rust_build /usr/local/cargo/bin/swh-graph* /usr/local/bin/                                                                                                                       0.2s
 => [stage-1 8/8] COPY --chmod=0755 entrypoint.sh                                                                                                                                                              0.0s
 => exporting to image                                                                                                                                                                                         0.7s
 => => exporting layers                                                                                                                                                                                        0.7s
 => => writing image sha256:3dce79663b5efcf27b952ee534d0159024bbfcedf859da98861fca8ed7ab6e08                                                                                                                   0.0s
 => => naming to docker.io/library/swh-graph:latest                                                                                                                                                            0.0s
root@1ae82ad0e689:/opt/swh# env | grep SWH
SWH_CONFIG_FILENAME=/config.yml
root@1ae82ad0e689:/opt/swh#

[2] Now

tony@kessel:~/work/inria/repo/swh/sysadm-environment/swh-apps (master) $ app=graph; prefix="swh-"; DOCKER_BUILDKIT=1 docker build -t "${prefix}${app}:latest" "apps/${prefix}${app}" --build-arg REGISTRY= && docker run -it "${prefix}${app}" shell
[+] Building 3.9s (18/18) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                                                           0.0s
 => => transferring dockerfile: 1.36kB                                                                                                                                                                         0.0s
 => [internal] load .dockerignore                                                                                                                                                                              0.0s
 => => transferring context: 2B                                                                                                                                                                                0.0s
 => [internal] load metadata for docker.io/library/base:latest                                                                                                                                                 0.0s
 => [internal] load metadata for docker.io/library/rust:1.85-bookworm                                                                                                                                          0.0s
 => [stage-1 1/8] FROM docker.io/library/base:latest                                                                                                                                                           0.0s
 => [internal] load build context                                                                                                                                                                              0.0s
 => => transferring context: 78B                                                                                                                                                                               0.0s
 => CACHED [internal] settings cache mount permissions                                                                                                                                                         0.0s
 => [rust_build 1/3] FROM docker.io/library/rust:1.85-bookworm                                                                                                                                                 0.0s
 => CACHED [stage-1 2/8] RUN apt-get update &&     apt-get install -y zstd &&     apt-get clean                                                                                                                0.0s
 => [stage-1 3/8] RUN mkdir -p /srv/graph /srv/dataset                                                                                                                                                         0.3s
 => CACHED [rust_build 2/3] RUN apt-get update &&     apt-get upgrade -y &&     apt-get install -y build-essential libclang-dev       zstd protobuf-compiler default-jre &&     apt-get clean                  0.0s
 => CACHED [rust_build 3/3] RUN --mount=type=cache,target=.cache,uid=1000,gid=1000   RUSTFLAGS="-C target-cpu=native"   cargo install swh-graph swh-graph-grpc-server                                          0.0s
 => [stage-1 4/8] RUN chown 1000:1000 /srv/graph /srv/dataset                                                                                                                                                  0.4s
 => [stage-1 5/8] COPY --chmod=0644 requirements-frozen.txt /opt/swh                                                                                                                                           0.1s
 => [stage-1 6/8] RUN --mount=type=cache,target=.cache,uid=1000,gid=1000     uv pip sync requirements-frozen.txt                                                                                               2.1s
 => [stage-1 7/8] COPY --from=rust_build /usr/local/cargo/bin/swh-graph* /usr/local/bin/                                                                                                                       0.2s
 => [stage-1 8/8] COPY --chmod=0755 entrypoint.sh /opt/swh                                                                                                                                                     0.1s
 => exporting to image                                                                                                                                                                                         0.7s
 => => exporting layers                                                                                                                                                                                        0.7s
 => => writing image sha256:3bca90ded185efa3a67d6d38c3c596a823c96ebe9616c328cb44f9484b510efc                                                                                                                   0.0s
 => => naming to docker.io/library/swh-graph:latest                                                                                                                                                            0.0s
swh@b92e577d7657:~$ whoami
swh
swh@b92e577d7657:~$ env | grep SWH_CONFIG_FILENAME
SWH_CONFIG_FILENAME=/etc/swh/config.yml

Refs. sysadm-environment#5608 (closed)

Edited by Antoine R. Dumont

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading