Skip to content

Commit 151e9e6

Browse files
committed
cleanup unused files and adapt github workflows
1 parent 77c9d54 commit 151e9e6

34 files changed

+49
-4464
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#ECCN:Open Source
2-
#GUSINFO:Languages,Heroku Stacks & Images
3-
* @heroku/languages
4-
1+
* @ninech/platform-team

.github/workflows/ci.yml

Lines changed: 21 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ on:
1414

1515
permissions:
1616
contents: read
17-
id-token: write
1817

1918
jobs:
2019
shellcheck:
@@ -34,10 +33,7 @@ jobs:
3433
fail-fast: false
3534
matrix:
3635
arch: ["amd64", "arm64"]
37-
stack-version: ["22", "24"]
38-
exclude:
39-
- arch: "arm64"
40-
stack-version: "22"
36+
stack-version: ["24"]
4137
steps:
4238
- name: Checkout
4339
uses: actions/checkout@v6
@@ -52,51 +48,16 @@ jobs:
5248
git diff
5349
exit 1
5450
fi
55-
- name: Generate Heroku runtime image files
56-
if: matrix.arch == 'amd64'
57-
run: |
58-
bin/generate-runtime-images.sh ${{ matrix.stack-version }}
5951
- name: Export base images from the Docker daemon
6052
if: github.ref_name == 'main' || github.ref_type == 'tag'
6153
run: |
62-
docker save $(docker images --format '{{.Repository}}:{{.Tag}}' | grep "heroku/heroku:${{ matrix.stack-version }}") | zstd -T0 --long=31 -o images.tar.zst
54+
docker save $(docker images --format '{{.Repository}}:{{.Tag}}' | grep "ninech/deploio-heroku:${{ matrix.stack-version }}") | zstd -T0 --long=31 -o images.tar.zst
6355
- name: Save OCI base image exports to the cache
6456
if: github.ref_name == 'main' || github.ref_type == 'tag'
6557
uses: actions/cache/save@v5
6658
with:
6759
key: ${{ github.run_id}}-${{ matrix.stack-version }}-${{ matrix.arch }}
6860
path: images.tar.zst
69-
- name: Save Heroku runtime image files to the cache
70-
if: matrix.arch == 'amd64' && github.ref_type == 'tag'
71-
uses: actions/cache/save@v5
72-
with:
73-
key: runtime-images-${{ github.run_id}}-${{ matrix.stack-version }}
74-
path: /tmp/heroku-${{ matrix.stack-version }}*
75-
76-
upload-runtime-images:
77-
if: github.ref_type == 'tag'
78-
name: "Upload heroku-${{ matrix.stack-version }} runtime images"
79-
needs:
80-
- build
81-
runs-on: ubuntu-24.04
82-
strategy:
83-
fail-fast: false
84-
matrix:
85-
stack-version: ["22", "24"]
86-
steps:
87-
- name: Checkout
88-
uses: actions/checkout@v6
89-
- name: Restore heroku runtime images from the cache
90-
uses: actions/cache/restore@v5
91-
with:
92-
fail-on-cache-miss: true
93-
key: runtime-images-${{ github.run_id}}-${{ matrix.stack-version }}
94-
path: /tmp/heroku-${{ matrix.stack-version }}*
95-
- name: Upload heroku runtime images to staging
96-
run: bin/upload-runtime-images.sh ${{ matrix.stack-version }} ${{ github.sha }}
97-
env:
98-
MANIFEST_APP_TOKEN: "${{ secrets.MANIFEST_APP_TOKEN }}"
99-
MANIFEST_APP_URL: "${{ secrets.MANIFEST_APP_URL }}"
10061

10162
publish-images:
10263
if: github.ref_name == 'main' || github.ref_type == 'tag'
@@ -110,10 +71,7 @@ jobs:
11071
fail-fast: false
11172
matrix:
11273
arch: ["amd64", "arm64"]
113-
stack-version: ["22", "24"]
114-
exclude:
115-
- arch: "arm64"
116-
stack-version: "22"
74+
stack-version: ["24"]
11775
steps:
11876
- name: Restore base images from the cache
11977
uses: actions/cache/restore@v5
@@ -127,32 +85,13 @@ jobs:
12785
run: zstd -dc --long=31 images.tar.zst | docker load
12886
- name: Log in to Docker Hub
12987
run: echo '${{ secrets.DOCKER_HUB_TOKEN }}' | docker login -u '${{ secrets.DOCKER_HUB_USERNAME }}' --password-stdin
130-
- name: Configure AWS credentials
131-
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5.1.1
132-
with:
133-
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_ECR_ROLE }}
134-
aws-region: ${{ vars.AWS_REGION }}
135-
- name: Log in to Amazon ECR Public
136-
id: login-ecr-public
137-
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
138-
with:
139-
registry-type: public
140-
- name: Publish base images to registries
88+
- name: Publish base images to registry
14189
run: |
142-
variants=("" "-build")
143-
platformSuffix=""
144-
if (( ${{ matrix.stack-version }} >= 24 )); then
145-
platformSuffix="_linux-${{ matrix.arch }}"
146-
else
147-
variants+=("-cnb" "-cnb-build")
148-
fi
149-
for variant in "${variants[@]}"; do
150-
srcTag="heroku/heroku:${{ matrix.stack-version}}${variant}"
151-
destTag="${srcTag}${platformSuffix}${TAG_SUFFIX}"
152-
for host in "docker.io" "public.ecr.aws"; do
153-
docker tag "${srcTag}" "${host}/${destTag}"
154-
docker push "${host}/${destTag}"
155-
done
90+
for variant in "" "-build"; do
91+
srcTag="ninech/deploio-heroku:${{ matrix.stack-version }}${variant}"
92+
destTag="${srcTag}_linux-${{ matrix.arch }}${TAG_SUFFIX}"
93+
docker tag "${srcTag}" "docker.io/${destTag}"
94+
docker push "docker.io/${destTag}"
15695
done
15796
15897
publish-indices:
@@ -170,90 +109,44 @@ jobs:
170109
steps:
171110
- name: Log in to Docker Hub
172111
run: echo '${{ secrets.DOCKER_HUB_TOKEN }}' | docker login -u '${{ secrets.DOCKER_HUB_USERNAME }}' --password-stdin
173-
- name: Configure AWS credentials
174-
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5.1.1
175-
with:
176-
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_ECR_ROLE }}
177-
aws-region: ${{ vars.AWS_REGION }}
178-
- name: Log in to Amazon ECR Public
179-
id: login-ecr-public
180-
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
181-
with:
182-
registry-type: public
183112
- name: Publish multi-arch image index
184113
run: |
185114
for variant in '' '-build'; do
186-
indexTag="heroku/heroku:${{ matrix.stack-version }}${variant}${TAG_SUFFIX}"
187-
armTag="heroku/heroku:${{ matrix.stack-version }}${variant}_linux-arm64${TAG_SUFFIX}"
188-
amdTag="heroku/heroku:${{ matrix.stack-version }}${variant}_linux-amd64${TAG_SUFFIX}"
189-
for host in 'docker.io' 'public.ecr.aws'; do
190-
docker manifest create "${host}/${indexTag}" "${host}/${amdTag}" "${host}/${armTag}"
191-
docker manifest push "${host}/${indexTag}"
192-
done
115+
indexTag="ninech/deploio-heroku:${{ matrix.stack-version }}${variant}${TAG_SUFFIX}"
116+
armTag="ninech/deploio-heroku:${{ matrix.stack-version }}${variant}_linux-arm64${TAG_SUFFIX}"
117+
amdTag="ninech/deploio-heroku:${{ matrix.stack-version }}${variant}_linux-amd64${TAG_SUFFIX}"
118+
docker manifest create "docker.io/${indexTag}" "docker.io/${amdTag}" "docker.io/${armTag}"
119+
docker manifest push "docker.io/${indexTag}"
193120
done
194121
195-
ctc-check:
196-
name: Obtain CTC Lock
197-
if: github.ref_type == 'tag'
198-
runs-on: ubuntu-24.04
199-
steps:
200-
- name: Obtain CTC Lock via TPS API
201-
run: |
202-
curl -sS --connect-timeout 5 --fail-with-body --retry-connrefused --retry 5 \
203-
-X PUT \
204-
-H "ACCEPT: application/json" \
205-
-H "Content-Type: application/json" \
206-
-H "Authorization: Token ${{ secrets.TPS_TOKEN }}" \
207-
-d '{"lock": {"sha": "${{ github.sha }}", "component_slug": "${{ vars.tps_component }}"}}' \
208-
"${{ secrets.TPS_CTC_API_URL }}"
209-
210122
promote-tags:
211123
if: github.ref_type == 'tag'
212124
name: "Promote heroku-${{ matrix.stack-version }} tags"
213125
needs:
214-
- ctc-check
215126
- publish-images
216127
- publish-indices
217128
runs-on: ubuntu-24.04
218129
strategy:
219130
fail-fast: false
220131
matrix:
221-
stack-version: ["22", "24"]
132+
stack-version: ["24"]
222133
steps:
223134
- name: Checkout
224135
uses: actions/checkout@v6
225136
- name: Log in to Docker Hub
226137
run: echo '${{ secrets.DOCKER_HUB_TOKEN }}' | docker login -u '${{ secrets.DOCKER_HUB_USERNAME }}' --password-stdin
227-
- name: Configure AWS credentials
228-
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5.1.1
229-
with:
230-
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_ECR_ROLE }}
231-
aws-region: ${{ vars.AWS_REGION }}
232-
- name: Log in to Amazon ECR Public
233-
id: login-ecr-public
234-
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
235-
with:
236-
registry-type: public
237138
- name: Install crane
238139
uses: buildpacks/github-actions/setup-tools@f3ec16c6d708761c6e87bbc8fe7f97375f80e7cd # v5.10.1
239140
- name: Promote images to stable tag
240141
run: |
241142
destTags=( )
242-
if (( ${{ matrix.stack-version }} >= 24 )); then
243-
for variant in '' '-build'; do
244-
for arch in 'amd64' 'arm64'; do
245-
destTags+=("heroku/heroku:${{ matrix.stack-version }}${variant}_linux-${arch}")
246-
done
247-
destTags+=("heroku/heroku:${{ matrix.stack-version }}${variant}")
248-
done
249-
else
250-
for variant in '' '-build' '-cnb' '-cnb-build'; do
251-
destTags+=("heroku/heroku:${{ matrix.stack-version }}${variant}")
143+
for variant in '' '-build'; do
144+
for arch in 'amd64' 'arm64'; do
145+
destTags+=("ninech/deploio-heroku:${{ matrix.stack-version }}${variant}_linux-${arch}")
252146
done
253-
fi
147+
destTags+=("ninech/deploio-heroku:${{ matrix.stack-version }}${variant}")
148+
done
254149
for destTag in "${destTags[@]}"; do
255150
srcTag="${destTag}.${{ github.ref_name }}"
256-
for host in "docker.io" "public.ecr.aws"; do
257-
crane copy "${host}/${srcTag}" "${host}/${destTag}"
258-
done
151+
crane copy "docker.io/${srcTag}" "docker.io/${destTag}"
259152
done

BUILD.md

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,14 @@ Add the package you want to the appropriate `setup.sh` for example `heroku-24/se
2626
+ libc6-dev
2727
```
2828

29-
Once done, run `bin/build.sh` locally to generate the corresponding `installed-packages*` files. Multi-arch base images (heroku-24 and beyond) will produce an `installed-packages-$ARCH.txt` for each architecture, while single architecture images will produce a singular `installed-packages.txt`.
29+
Once done, run `bin/build.sh` locally to generate the corresponding `installed-packages*` files. Multi-arch base images (heroku-24 and beyond) will produce an `installed-packages-$ARCH.txt` for each architecture.
3030

3131
The `*-build` variants include all the packages from the non-build variant by default. This means that if you're adding a package to both, you only need to add them to the non-build variant. The example above will add `libc6-dev` to both `heroku-24` and `heroku-24-build`.
3232

33-
The `*cnb*` variants (which only exist for heroku-22 and prior) inherit the installed packages from the non-`*cnb*` variant. Add packages to a non-`*cnb*` variant to add them to the `*cnb*` variant.
33+
# Releasing Base Images
3434

35-
# Releasing Heroku Base Images
35+
We use GitHub Actions to build and release the base images:
3636

37-
We use GitHub Actions to build and release Heroku Base Images:
38-
39-
* Any push to `main` will build the images and push the nightly Docker tag variants (such as `heroku/heroku:24-build.nightly`).
40-
* Any new Git tag will build the image and push the latest Docker tag (such as `heroku/heroku:24-build`),
41-
as well as a versioned tag (such as `heroku/heroku:24-build.v123`). The `arm64` images will then also be
42-
converted to a Heroku-specific `.img` format and uploaded to S3 for consumption by the runtime hosts.
43-
44-
# Generating `.img` format Base Images locally
45-
46-
To test the generation of the Heroku-specific, amd64-only `.img` file:
47-
48-
1. Build the Docker images for your chosen stack as normal above.
49-
2. `docker build --platform=linux/amd64 ./tools -t heroku-image-tools`
50-
3. `docker run -it --rm --platform=linux/amd64 --privileged -v /var/run/docker.sock:/var/run/docker.sock heroku-image-tools STACK_VERSION` (where `STACK_VERSION` is a integer version like `24`)
37+
* Any push to `main` will build the images and push the nightly Docker tag variants (such as `ninech/deploio-heroku:24-build.nightly`).
38+
* Any new Git tag will build the image and push the latest Docker tag (such as `ninech/deploio-heroku:24-build`),
39+
as well as a versioned tag (such as `ninech/deploio-heroku:24-build.v123`).

README.md

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
1-
## Heroku Base Images
2-
3-
[![CI](https://github.com/heroku/base-images/actions/workflows/ci.yml/badge.svg)](https://github.com/heroku/base-images/actions/workflows/ci.yml)
4-
5-
This repository holds recipes for building the base images for [Heroku stacks](https://devcenter.heroku.com/articles/stack).
6-
The recipes are also rendered into Docker images that are available on Docker Hub:
7-
8-
| Image | Type | OS | Supported Architectures | Default `USER` | Status |
9-
|-------------------------------------------|------------------------|--------------|-------------------------|----------------| -------------|
10-
| [heroku/heroku:20][heroku-tags] | Heroku Run Image | Ubuntu 20.04 | AMD64 | `root` | End-of-life |
11-
| [heroku/heroku:20-build][heroku-tags] | Heroku Build Image | Ubuntu 20.04 | AMD64 | `root` | End-of-life |
12-
| [heroku/heroku:20-cnb][heroku-tags] | CNB Run Image | Ubuntu 20.04 | AMD64 | `heroku` | End-of-life |
13-
| [heroku/heroku:20-cnb-build][heroku-tags] | CNB Build Image | Ubuntu 20.04 | AMD64 | `heroku` | End-of-life |
14-
| [heroku/heroku:22][heroku-tags] | Heroku Run Image | Ubuntu 22.04 | AMD64 | `root` | Available |
15-
| [heroku/heroku:22-build][heroku-tags] | Heroku Build Image | Ubuntu 22.04 | AMD64 | `root` | Available |
16-
| [heroku/heroku:22-cnb][heroku-tags] | CNB Run Image | Ubuntu 22.04 | AMD64 | `heroku` | Available |
17-
| [heroku/heroku:22-cnb-build][heroku-tags] | CNB Build Image | Ubuntu 22.04 | AMD64 | `heroku` | Available |
18-
| [heroku/heroku:24][heroku-tags] | Heroku/CNB Run Image | Ubuntu 24.04 | AMD64 + ARM64 | `heroku` | Recommended |
19-
| [heroku/heroku:24-build][heroku-tags] | Heroku/CNB Build Image | Ubuntu 24.04 | AMD64 + ARM64 | `heroku` | Recommended |
1+
## ninech/deploio-heroku Base Images
2+
3+
[![CI](https://github.com/ninech/heroku-stack-base-images/actions/workflows/ci.yml/badge.svg)](https://github.com/ninech/heroku-stack-base-images/actions/workflows/ci.yml)
4+
5+
This is a ninech fork of [heroku/base-images](https://github.com/heroku/base-images), adapted for use with [deplo.io](https://deplo.io).
6+
The recipes are rendered into Docker images available on Docker Hub:
7+
8+
| Image | Type | OS | Supported Architectures | Default `USER` | Status |
9+
|----------------------------------------------------|----------------|--------------|-------------------------|----------------|-------------|
10+
| [ninech/deploio-heroku:24][ninech-tags] | Run Image | Ubuntu 24.04 | AMD64 + ARM64 | `deploio` | Recommended |
11+
| [ninech/deploio-heroku:24-build][ninech-tags] | Build Image | Ubuntu 24.04 | AMD64 + ARM64 | `deploio` | Recommended |
2012

2113
The build image variants use the run images as their base, but include additional packages needed
2214
at build time such as development headers and compilation toolchains.
2315

24-
The CNB image variants contain additional metadata and changes required to make them compatible with
25-
Heroku's Cloud Native Buildpacks [builder images](https://github.com/heroku/cnb-builder-images).
26-
27-
For images where the default `USER` is `heroku`, you will need to switch back to the `root` user when
28-
modifying locations other then `/home/heroku` and `/tmp`. You can do this by adding `USER root` to
16+
For images where the default `USER` is `deploio`, you will need to switch back to the `root` user when
17+
modifying locations other than `/home/deploio` and `/tmp`. You can do this by adding `USER root` to
2918
your `Dockerfile` when building images, or by passing `--user root` to any `docker run` invocations.
3019

3120
### Learn more
@@ -35,5 +24,5 @@ your `Dockerfile` when building images, or by passing `--user root` to any `dock
3524

3625
See [BUILD.md](BUILD.md) for instructions on how to build the images yourself.
3726

38-
[heroku-tags]: https://hub.docker.com/r/heroku/heroku/tags
27+
[ninech-tags]: https://hub.docker.com/r/ninech/deploio-heroku/tags
3928
[ubuntu-tags]: https://hub.docker.com/_/ubuntu?tab=tags

bin/build.sh

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -euo pipefail
55
cd "$(dirname "${BASH_SOURCE[0]}")/.."
66
. bin/stack-helpers.sh
77

8-
REPO="heroku/heroku"
8+
REPO="ninech/deploio-heroku"
99
STACK_VERSION=${1:-"NAN"}
1010
read -ra ARCHS <<< "${@:2}"
1111
BASE_NAME=$(basename "${BASH_SOURCE[0]}")
@@ -51,25 +51,10 @@ if docker info -f "{{ .DriverStatus }}" | grep -qF "io.containerd.snapshotter.";
5151
have_containerd_snapshotter=1;
5252
fi
5353

54-
if (( STACK_VERSION <= 22 )); then
55-
# heroku/heroku:22 and prior images do not support multiple chip
56-
# architectures or multi-arch images. Instead, they are amd64 only.
57-
if (( ${#ARCHS[@]} == 0 )); then
58-
ARCHS=("amd64")
59-
fi
60-
# heroku/heroku:22 and prior images need separate *cnb* variants that
61-
# add compatibility for Cloud Native Buildpacks.
62-
VARIANTS=("-build:" "-cnb:" "-cnb-build:-build")
63-
else
64-
# heroku/heroku:24 and beyond support amd64 and arm64 and are published
65-
# as multi-arch images.
66-
if (( ${#ARCHS[@]} == 0 )); then
67-
ARCHS=("amd64" "arm64")
68-
fi
69-
# heroku/heroku:24 and beyond images include CNB specific
70-
# modifications, so separate *cnb* variants are not created.
71-
VARIANTS=("-build:")
54+
if (( ${#ARCHS[@]} == 0 )); then
55+
ARCHS=("amd64" "arm64")
7256
fi
57+
VARIANTS=("-build:")
7358

7459
if (( ${#ARCHS[@]} > 1 )) && [[ ! $have_containerd_snapshotter ]] ; then
7560
>&2 print_usage
@@ -124,13 +109,9 @@ for VARIANT in "${VARIANTS[@]}"; do
124109
--build-arg "BASE_IMAGE=${DEPENDENCY_IMAGE_TAG}" \
125110
--tag "${VARIANT_IMAGE_TAG}" "${VARIANT_DOCKERFILE_DIR}" | indent
126111

127-
# generate the package list for non-cnb variants. cnb variants don't
128-
# influence the list of installed packages.
129-
if [[ ! "$VARIANT_NAME" = -cnb* ]]; then
130-
write_package_list "$VARIANT_IMAGE_TAG" "$VARIANT_DOCKERFILE_DIR"
131-
fi
112+
write_package_list "$VARIANT_IMAGE_TAG" "$VARIANT_DOCKERFILE_DIR"
132113
done
133114

134115
display "Size breakdown..."
135116
docker images --format "table {{.Repository}}:{{.Tag}}\t{{.Size}}" \
136-
| grep -E "(ubuntu|heroku)" | sed '1!G;h;$!d' | indent
117+
| grep -E "(ubuntu|ninech)" | sed '1!G;h;$!d' | indent

bin/generate-runtime-images.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)