Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG ELIXIR_VERSION=1.20.4
ARG ERLANG_VERSION=29.1.1
ARG DEBIAN_VERSION=trixie-20260918-slim
ARG DEBIAN_VERSION=trixie-20261005-slim

FROM hexpm/elixir:${ELIXIR_VERSION}-erlang-${ERLANG_VERSION}-debian-${DEBIAN_VERSION} AS build

Expand All @@ -9,7 +9,7 @@ ENV LANG=C.UTF-8
# install build dependencies
RUN apt update -y && \
apt upgrade -y && \
apt install -y --no-install-recommends git build-essential ca-certificates && \
apt install -y --no-install-recommends ca-certificates && \
apt clean -y && rm -rf /var/lib/apt/lists/*

# prepare build dir
Expand Down Expand Up @@ -61,7 +61,7 @@ FROM debian:${DEBIAN_VERSION} AS app

# Erlang/OTP loads libsctp.so.1 when it starts and prints a warning without it
RUN apt update -y && \
apt install --no-install-recommends -y apt-transport-https awscli bash build-essential ca-certificates coreutils curl docker-cli gnupg gzip libffi-dev libsctp1 libssl-dev openssl python3-dev tar zip && \
apt install --no-install-recommends -y awscli bash ca-certificates coreutils curl docker-cli libsctp1 openssl && \
apt clean -y && rm -rf /var/lib/apt/lists/*

ARG BUILDX_VERSION=0.17.1
Expand All @@ -72,15 +72,9 @@ RUN mkdir -p /usr/libexec/docker/cli-plugins && \

COPY --from=ghcr.io/sigstore/cosign/cosign:v3.1.3@sha256:9e5c2f2edc34351160407ca3416c61855bdf9403c3c5936e0f0be7fc261611b8 /ko-app/cosign /usr/local/bin/cosign

RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && \
apt update -y && apt install --no-install-recommends -y google-cloud-cli && \
apt clean -y && rm -rf /var/lib/apt/lists/*

# The release creates /app/tmp when it starts and writes its runtime config
# there, so /app is nobody's.
RUN mkdir /app /boto /persist && chown nobody:nogroup /app /boto /persist
COPY --chown=65534:65534 etc/boto /app/.boto
RUN mkdir /app /gcp /persist && chown nobody:nogroup /app /gcp /persist

WORKDIR /app

Expand All @@ -92,6 +86,9 @@ USER nobody

ENV HOME=/app
ENV LANG=C.UTF-8
# awscli verifies servers against the CA bundle it ships with unless this
# points it at another one
ENV AWS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
# Declared here, in the last stage, so a new commit does not invalidate the
# build cache for everything above it. PromEx reads these to report which
# revision is running.
Expand Down
2 changes: 0 additions & 2 deletions etc/boto

This file was deleted.

8 changes: 4 additions & 4 deletions lib/bob/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule Bob.Application do
BobWeb.BanditTelemetry.attach()

setup_docker()
setup_gsutil()
setup_gcp_credentials()
auth_docker()
validate_jobs()

Expand Down Expand Up @@ -77,11 +77,11 @@ defmodule Bob.Application do
end
end

defp setup_gsutil() do
defp setup_gcp_credentials() do
if credentials = System.get_env("BOB_GCP_CREDENTIALS") do
credentials = fix_env_newlines(credentials)
File.mkdir_p!("/boto")
File.write!("/boto/keyfile.json", credentials)
File.mkdir_p!("/gcp")
File.write!("/gcp/keyfile.json", credentials)
end
end

Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%{
"bandit": {:hex, :bandit, "1.12.5", "af205a8e550f304caae09a97d29fd3c79a7f337526ea7cd772d2ff11d2f7c800", [:mix], [{:hpax, "~> 1.0", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.18", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:thousand_island, "~> 1.5", [hex: :thousand_island, repo: "hexpm", optional: false]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "c5684ca062fa407cac115aec3256383f3e2ec9fdced7904d59cf5a7bb7ed6181"},
"castore": {:hex, :castore, "1.0.21", "0a0e8330dc267a40a3b7ad86d39302764bb71758172904e6a59d5ad6443ce307", [:mix], [], "hexpm", "e42e22723e25dbd46876d056a03f685513d6e98f6b5e555dc551321decd76c5c"},
"castore": {:hex, :castore, "1.0.22", "a01978e6a5d42fa3a34143630588f92036e7d90e2309ecdd466722d1279a2213", [:mix], [], "hexpm", "c2a4d42723b4affbc1c3e15d8f6df3f7d8f1f627c84de643383634cce58493d5"},
"cc_precompiler": {:hex, :cc_precompiler, "0.1.11", "8c844d0b9fb98a3edea067f94f616b3f6b29b959b6b3bf25fee94ffe34364768", [:mix], [{:elixir_make, "~> 0.7", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "3427232caf0835f94680e5bcf082408a70b48ad68a5f5c0b02a3bea9f3a075b9"},
"circular_buffer": {:hex, :circular_buffer, "1.1.0", "af9332c40d600cc27b160eebd9fad1bf0a8106cd62e9f57d6cc8f028d3cc46d1", [:mix], [], "hexpm", "0daa0a4fcb3a7ffabc8576bdbf64c99adc6d4b37eab1185179140769ba58f571"},
"db_connection": {:hex, :db_connection, "2.10.2", "ae391e803a5adff104da913c2fc1c0c14a37f8b10001dcef568796e1fb7bf95c", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "510b14482330f1af6490a2fa0efd8d4f1435d1529b165647df22ac0f2df0fa93"},
Expand Down
2 changes: 1 addition & 1 deletion priv/scripts/docker/sign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tag=$2
digest=sha256:$(docker buildx imagetools inspect --raw ${repo}:${tag} | sha256sum | cut -d ' ' -f 1)

# Cloud KMS is called as the service account whose key Bob.Application writes here
export GOOGLE_APPLICATION_CREDENTIALS=/boto/keyfile.json
export GOOGLE_APPLICATION_CREDENTIALS=/gcp/keyfile.json

# This command has a tendency to intermittently fail
cosign sign --yes --key ${BOB_COSIGN_KEY} ${repo}@${digest} ||
Expand Down
61 changes: 0 additions & 61 deletions priv/scripts/prepare_elixir_builds_text.exs

This file was deleted.

51 changes: 0 additions & 51 deletions priv/scripts/prepare_otp_builds_text.exs

This file was deleted.

23 changes: 0 additions & 23 deletions priv/scripts/utils.sh

This file was deleted.

Loading