Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Debian bullseye on CI/CD/Dockerfile #1005

Merged
merged 26 commits into from Sep 13, 2021

Conversation

thiagokokada
Copy link
Contributor

Fix issue #866.

Also, many QoL changes on Dockerfile/.cicleci/config.yml.

Also, some QoL changes on the `Dockerfile`:
- Parametrize GRAALVM_VERSION to make it easier to update
- Remove installing programs already included on base image
- Remove `deps.edn` from `.dockerignore` since it is necessary to build
Also some modifications necessary to make it work:
- Migrate from `circleci` images to `clojure` since they're out-of-date
  and also seem to be considered legacy:
  https://circleci.com/docs/2.0/circleci-images/#legacy-language-images
- Remove unnecessary usage of `sudo`, since all commands runs as root
- Sync packages with `Dockerfile`. This will make easier to test locally
  if everything will work (of course, it is not 100% guarantee)
.circleci/config.yml Outdated Show resolved Hide resolved
.circleci/config.yml Show resolved Hide resolved
.circleci/config.yml Outdated Show resolved Hide resolved
@@ -12,7 +12,6 @@ test/
.gitmodules
appveyor.yml
CHANGES.md
deps.edn
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how this worked before, but this file is necessary to build using the Dockerfile.


ENV DEBIAN_FRONTEND=noninteractive
RUN apt update
RUN apt install --no-install-recommends -yy curl unzip build-essential zlib1g-dev sudo
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curl, unzip are already included on clojure:openjdk-11-lein-2.9.6-bullseye. sudo is not used anywhere in the Dockerfile (and also, all commands already run as root).

Comment on lines -15 to -37
# This script sets up the latest available musl-tools using apt pinning from Debian bullseye (11).
# The one available in stretch (Debian 9) is outdated and this ensures we get the latest improvements
# This explictly installs musl from bullseye and keeps the others at a higher priority
# TODO: remove after clojure image is updated to bullseye

cat >> /etc/apt/sources.list <<eof
deb http://ftp.us.debian.org/debian bullseye main non-free contrib
deb http://non-us.debian.org/debian-non-us bullseye/non-us main contrib non-free
eof

cat >> /etc/apt/preferences <<eof
Package: *
Pin: release a=stable
Pin-Priority: 700
Package: *
Pin: release a=testing
Pin-Priority: 650
Package: *
pin: release a=bullseye
pin-priority: 600
eof

apt-get update -y && apt-get install musl-tools/bullseye -y
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary to backport anymore since we are already using bullseye.

Comment on lines -187 to -190
- run:
name: Install lsof
command: |
sudo apt-get install lsof
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not used anywhere and not available on clojure:openjdk-11-lein-2.9.6-bullseye by default.

@thiagokokada thiagokokada marked this pull request as draft September 9, 2021 21:32
Already included on the base image.
.circleci/config.yml Outdated Show resolved Hide resolved
@thiagokokada
Copy link
Contributor Author

Huh... I thought that CircleCI built everything as root, but it seems it builds with a non-root user. So this approach will not work, sadly.

@borkdude
Copy link
Collaborator

borkdude commented Sep 9, 2021

@thiagokokada You can use sudo though.

@thiagokokada
Copy link
Contributor Author

@thiagokokada You can use sudo though.

It is not available on clojure:openjdk-11-lein-2.9.6-bullseye by default, and we have a chicken-egg problem for installing it (I can't use sudo apt install sudo without sudo).

@thiagokokada
Copy link
Contributor Author

Actually, it does seem that the commands without sudo worked, so the problem seems something else. Needs more investigation...

@@ -7,7 +7,7 @@ jobs:
jvm:
docker:
# specify the version you desire here
- image: circleci/clojure:lein-2.9.1
- image: circleci/clojure:lein-2.9.6
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jvm needs PostgreSQL to run, so using the circleci/clojure:lein-2.9.6 that already includes it by default.

@thiagokokada
Copy link
Contributor Author

@borkdude Well, it is working now (sorry for all the runs on CircleCI). BTW, what I said above was wrong, the error was purely my fault.

Not entirely happy with this PR, will wait some days to see if CircleCI releases their updated image with more tooling included. However if they do not, I will open the PR for review later.

@borkdude
Copy link
Collaborator

Thanks so far, I'll wait.

@thiagokokada thiagokokada force-pushed the use-bullseye branch 3 times, most recently from 0ed8639 to 7951a21 Compare September 10, 2021 09:12
@borkdude
Copy link
Collaborator

@thiagokokada Could you perhaps not use force push? I don't think it adds anything, but it makes following what's going on a lot harder for me. The Github UI shows "this isn't here anymore"-like things when I click on the notifications.

@thiagokokada
Copy link
Contributor Author

Sorry @borkdude, will avoid this from now on.

@thiagokokada
Copy link
Contributor Author

I think for clean-ups is pretty much it, I will just wait to see if CircleCI will release a new version of their Clojure image.

@thiagokokada thiagokokada marked this pull request as ready for review September 13, 2021 21:20
@thiagokokada
Copy link
Contributor Author

@borkdude It is ready now.

@borkdude borkdude merged commit 9ca3a3b into babashka:master Sep 13, 2021
@borkdude
Copy link
Collaborator

@thiagokokada Beautiful, thank you!

@thiagokokada thiagokokada deleted the use-bullseye branch September 15, 2021 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants