Compare commits

...

10 commits

Author SHA1 Message Date
28cb112243 [#1] Build CI environment for .NET
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-11-13 11:51:48 +03:00
eb9cae2f79 Clean up Makefile default values
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-10-25 16:20:31 +03:00
18d7a6e0ae Explain image modification process
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-10-25 16:04:59 +03:00
d837dacfd1 Require git binary in Actions images
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-10-25 15:49:45 +03:00
b9ee619374 Use vfs storage driver for building container images
Some of our Forgejo Runners use tmpfs, which causes buildah to fail:
 * https://stackoverflow.com/questions/72651641
 * 9665efd712/troubleshooting.md (6-rootless-buildah-build-fails-when-using-overlayfs)

Instead of switching to overlayfs which may or may not work depending on
kernel module being loaded, we will use vfs because it always works.
Performance loss is not critical in our usage scenario

Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-10-25 15:49:45 +03:00
1b4e256d1d Fix registry logout syntax
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-10-24 18:11:44 +03:00
a3b7e14413 Fix tag name reference in push-% recipe
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-10-24 18:08:58 +03:00
ab35bf6f37 Debug REGISTRY_PASSWORD without revealing it
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-10-24 18:03:52 +03:00
e128ea6fdd Rebuild all images if workflow triggered manually
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-10-24 17:32:35 +03:00
22d46bfb6f Use separate Makefile target for pushing to registry
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-10-24 17:26:50 +03:00
6 changed files with 46 additions and 18 deletions

View file

@ -14,6 +14,8 @@ jobs:
- openjdk-11-maven-3.8.6 - openjdk-11-maven-3.8.6
- python-3.11 - python-3.11
- python-3.13 - python-3.13
env:
STORAGE_DRIVER: vfs
steps: steps:
- name: Clone git repo - name: Clone git repo
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -26,18 +28,26 @@ jobs:
id: changed id: changed
- name: Install Buildah - name: Install Buildah
run: apt update; apt install -y buildah run: |-
if: steps.changed.outputs.any_changed == 'true' apt update; apt install -y buildah
# STORAGE_DRIVER variable is ignored if this file does not exist
touch /etc/containers/storage.conf
if: >-
github.event_name == 'workflow_dispatch'
|| steps.changed.outputs.any_changed == 'true'
- name: Build OCI image - name: Build OCI image
run: make ${{matrix.tag}} run: make ${{matrix.tag}}
if: steps.changed.outputs.any_changed == 'true' if: >-
github.event_name == 'workflow_dispatch'
|| steps.changed.outputs.any_changed == 'true'
- name: Push image to OCI registry - name: Push image to OCI registry
run: make ${{matrix.tag}} PUSH=y run: make push-${{matrix.tag}}
if: >- if: >-
steps.changed.outputs.any_changed == 'true' github.ref == 'refs/heads/master' &&
&& github.ref == 'refs/heads/master' (github.event_name == 'workflow_dispatch' ||
&& github.event_name == 'push' (steps.changed.outputs.any_changed == 'true' && github.event_name == 'push'))
env: env:
REGISTRY_PASSWORD: ${secrets.REGISTRY_PASSWORD} REGISTRY_PASSWORD: ${{secrets.REGISTRY_PASSWORD}}

View file

@ -1,11 +1,9 @@
PUSH?=
REGISTRY?=git.frostfs.info REGISTRY?=git.frostfs.info
REGISTRY_NAMESPACE?=truecloudlab REGISTRY_NAMESPACE?=truecloudlab
REGISTRY_USER?=$(REGISTRY_NAMESPACE) REGISTRY_USER?=$(REGISTRY_NAMESPACE)
REGISTRY_PASSWORD?= REGISTRY_PASSWORD?=
IMAGE=$(REGISTRY)/$(REGISTRY_NAMESPACE)/env IMAGE?=$(REGISTRY)/$(REGISTRY_NAMESPACE)/env
TAGS=$(patsubst %/.,%,$(wildcard */.)) TAGS=$(patsubst %/.,%,$(wildcard */.))
.PHONY: $(TAGS) .PHONY: $(TAGS)
@ -13,8 +11,10 @@ $(TAGS):
buildah images buildah images
cd $@ && buildah bud --tag $(IMAGE):$@ . cd $@ && buildah bud --tag $(IMAGE):$@ .
buildah images buildah images
ifneq (,$(PUSH))
echo $$REGISTRY_PASSWORD | buildah login --username $(REGISTRY_USER) --password-stdin $(REGISTRY) PUSH=$(foreach tag,$(TAGS),push-$(tag))
buildah push --rm $(IMAGE):$@ docker://$(IMAGE):$@ $(PUSH):
buildah logout echo -n "$$REGISTRY_PASSWORD" | wc
endif echo "$$REGISTRY_PASSWORD" | buildah login --username $(REGISTRY_USER) --password-stdin $(REGISTRY)
buildah push --rm $(IMAGE):$(patsubst push-%,%,$@) docker://$(IMAGE):$(patsubst push-%,%,$@)
buildah logout $(REGISTRY)

View file

@ -5,3 +5,17 @@ is available by default. This is not the case in Forgejo Actions, and we need
to add Node.js to community provided images explicitly. to add Node.js to community provided images explicitly.
This repo contains Dockerfile for images used by TrueCloudLab. This repo contains Dockerfile for images used by TrueCloudLab.
Images are published to [our registry](https://git.frostfs.info/TrueCloudLab/-/packages/container/env/versions)
## Modifying container images
Prepare a pull request with a modified or entirely new Dockerfile.
The image will get built and published after PR is merged to master.
## Requirements
Images for Forgejo Actions must contain:
- Node.js
- Git

4
dotnet-8.0/Dockerfile Normal file
View file

@ -0,0 +1,4 @@
FROM docker.io/node:20-bookworm-slim as node
FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim
COPY --from=node /usr/local /usr/local
COPY --from=node /opt /opt

View file

@ -1,4 +1,4 @@
FROM docker.io/node:20-bookworm-slim as node FROM docker.io/node:20-bookworm-slim as node
FROM docker.io/python:3.11-slim-bookworm FROM docker.io/python:3.11-bookworm
COPY --from=node /usr/local /usr/local COPY --from=node /usr/local /usr/local
COPY --from=node /opt /opt COPY --from=node /opt /opt

View file

@ -1,4 +1,4 @@
FROM docker.io/node:20-bookworm-slim as node FROM docker.io/node:20-bookworm-slim as node
FROM docker.io/python:3.13-slim-bookworm FROM docker.io/python:3.13-bookworm
COPY --from=node /usr/local /usr/local COPY --from=node /usr/local /usr/local
COPY --from=node /opt /opt COPY --from=node /opt /opt