Skip to content

Commit

Permalink
fix: add yq to build image (#7338)
Browse files Browse the repository at this point in the history
* add `yq` to build image Earthfile.
* Fix sysbox to be Earthfile compatible.
  • Loading branch information
charlielye authored Jul 19, 2024
1 parent 645aec1 commit 6035595
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
8 changes: 6 additions & 2 deletions build-images/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ build:
&& mv wasmtime-v20.0.2-$(uname -m)-linux/wasmtime /usr/local/bin \
&& rm -rf wasmtime*

# Install yq
RUN curl -sL https://github.com/mikefarah/yq/releases/download/v4.42.1/yq_linux_$(dpkg --print-architecture) \
-o /usr/local/bin/yq && chmod +x /usr/local/bin/yq

ARG TARGETARCH
# NOTE: bump this version when doing non-backwards compatible changes
SAVE IMAGE --push aztecprotocol/build:1.0-$TARGETARCH
Expand Down Expand Up @@ -393,7 +397,7 @@ sysbox:
e2scrub_reap.service

# Make use of stopsignal (instead of sigterm) to stop systemd containers.
STOPSIGNAL SIGRTMIN+3
#STOPSIGNAL SIGRTMIN+3

# Set systemd as entrypoint.
ENTRYPOINT [ "/sbin/init", "--log-level=err" ]
Expand All @@ -404,7 +408,7 @@ sysbox:
RUN curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh \
# Add user "ubuntu" to the Docker group
&& usermod -a -G docker ubuntu
ADD https://raw.githubusercontent.com/docker/docker-ce/master/components/cli/contrib/completion/bash/docker /etc/bash_completion.d/docker.sh
RUN curl -fsSL https://raw.githubusercontent.com/docker/docker-ce/master/components/cli/contrib/completion/bash/docker -o /etc/bash_completion.d/docker.sh

# Install sshd.
RUN apt install --no-install-recommends -y openssh-server \
Expand Down
15 changes: 13 additions & 2 deletions build-images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,19 @@ $ earthly +devbox
```

This will take significant time and compute however, as it builds several toolchains from the ground up.
If you have a reasonable internet connection, leveraging the cache to avoid building maybe prefereable.
If you have a reasonable internet connection, leveraging the cache to avoid building maybe preferable.

```
$ earthly --use-inline-cache +devbox
```
```

### Building the sysbox

The sysbox is the image that internal aztec engineers run on the mainframe. A mainframe administrator can run:

```
$ earthly +sysbox
```

This will rebuild the sysbox image, and once users perform a `sudo halt` their box should reboot with the new image.
If the image tag changes, you'll need to update it in `/usr/local/bin/launch_sysbox`.

0 comments on commit 6035595

Please sign in to comment.