Skip to content

feat(workflow): push apisix:dev image on commit#12300

Merged
SkyeYoung merged 16 commits into
apache:masterfrom
SkyeYoung:young/feat/workflow/push-dev-image-on-commit
Jun 12, 2025
Merged

feat(workflow): push apisix:dev image on commit#12300
SkyeYoung merged 16 commits into
apache:masterfrom
SkyeYoung:young/feat/workflow/push-dev-image-on-commit

Conversation

@SkyeYoung

@SkyeYoung SkyeYoung commented Jun 9, 2025

Copy link
Copy Markdown
Member

Description

What

This is a part of #12234.

This PR add a workflow, so that when submitting a commit in any PR, the build and push(only master) of the apisix:dev image will be triggered.

How

This PR moves the https://github.com/apache/apisix-docker/blob/d5322d57d58c569d98c225f89a8abd991429ec10/.github/workflows/apisix_dev_push_docker_hub.yaml and related files into apisix.

Why

  1. During the development and CI process of apisix-dashboard, the latest dev image with the latest code is required.
  2. The dev images built in apisix-docker in the past were more like nightly images, only released at a specific time each day, which hindered developers from using images with the latest code for testing.
  3. Since apisix-dashboard has already been integrated into apisix, the apisix-docker repository no longer has much significance and also lacks maintenance. Integrating it directly into the apisix repository will be easier to maintain.

Depend on

Which issue(s) this PR fixes:

Fixes #

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

Comment on lines +3 to +10
on:
push:
branches:
- master
paths-ignore:
- "docs/**"
- "**/*.md"
workflow_dispatch:

@SkyeYoung SkyeYoung Jun 9, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Here is the only difference from https://github.com/apache/apisix-docker/blob/master/.github/workflows/apisix_dev_push_docker_hub.yaml .

  1. Removed the schedule because we are already able to ensure the latest.
  2. Added workflow_dispatch to allow manual triggering of builds if necessary.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It is best to build each time a contributor commits (in the their dev branch), but not push, to help us detect potential build errors in advance.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It is best to build each time a contributor commits (in the their dev branch), but not push, to help us detect potential build errors in advance.

done.

Comment on lines +39 to +40
restart: always
environment:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment on lines +23 to +33
wget -q https://github.com/google/brotli/archive/refs/tags/v${BORTLI_VERSION}.zip || exit 1
unzip v${BORTLI_VERSION}.zip && cd ./brotli-${BORTLI_VERSION} && mkdir build && cd build || exit 1
local CMAKE=$(command -v cmake3 >/dev/null 2>&1 && echo cmake3 || echo cmake) || exit 1
${CMAKE} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/brotli .. || exit 1
sudo ${CMAKE} --build . --config Release --target install || exit 1
if [ -d "/usr/local/brotli/lib64" ]; then
echo /usr/local/brotli/lib64 | sudo tee /etc/ld.so.conf.d/brotli.conf
else
echo /usr/local/brotli/lib | sudo tee /etc/ld.so.conf.d/brotli.conf
fi
sudo ldconfig || exit 1

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Here, change all "exit -1" to "exit 1".

I don't know how the original file in apisix-docker passed the review before, which doesn't fit the shell specifications I know, nor can I pass the ci in apisix

image

https://github.com/apache/apisix/actions/runs/15530989377/job/43719749891?pr=12300

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

CleanShot 2025-06-09 at 17 19 38@2x

This change won't break any existing logic, because I don't see any place that receives -1 either.

This comment was marked as outdated.

@SkyeYoung
SkyeYoung marked this pull request as ready for review June 9, 2025 09:29
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request github_actions Pull requests that update GitHub Actions code labels Jun 9, 2025
@SkyeYoung SkyeYoung changed the title feat(workflow): add push dev image on commit feat(workflow): add push apisix:dev image on commit Jun 9, 2025
@SkyeYoung SkyeYoung changed the title feat(workflow): add push apisix:dev image on commit feat(workflow): push apisix:dev image on commit Jun 9, 2025
@SkyeYoung

SkyeYoung commented Jun 9, 2025

Copy link
Copy Markdown
Member Author

The current script itself has problems and cannot be built in the apisix-docker repository.

https://github.com/apache/apisix-docker/actions/runs/15524834524

I tried it locally and couldn't build the image

image

Waiting for a fix in apisix.

@juzhiyuan juzhiyuan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Need @bzp2010 @nic-6443's help to have a review 🙏

@SkyeYoung

SkyeYoung commented Jun 10, 2025

Copy link
Copy Markdown
Member Author

The current script itself has problems and cannot be built in the apisix-docker repository.

apache/apisix-docker/actions/runs/15524834524

I tried it locally and couldn't build the image

image

Waiting for a fix in apisix.

Merged the latest master of APISIX, all working fine.

CleanShot 2025-06-10 at 17 41 21@2x

@SkyeYoung
SkyeYoung requested a review from nic-6443 June 10, 2025 09:57
nic-6443

This comment was marked as resolved.

nic-6443
nic-6443 previously approved these changes Jun 11, 2025
Comment thread docker/debian-dev/Dockerfile Outdated
# limitations under the License.
#

FROM api7/apisix-runtime:dev AS build

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@nic-6443
nic-6443 self-requested a review June 11, 2025 07:10
runs-on: ubuntu-latest

env:
APISIX_VERSION: master

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this env is unused?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

removed

@SkyeYoung
SkyeYoung requested review from AlinsRan and nic-6443 June 11, 2025 11:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR integrates the dev-image build pipeline into the main repository by moving Docker scripts and workflows from apisix-docker into apisix, and adds a GitHub Actions workflow to build and push the apache/apisix:dev image on every commit.

  • Introduce check_standalone_config.sh to validate standalone-mode settings
  • Add install-brotli.sh, docker-entrypoint.sh, Debian-dev Dockerfile and compose files
  • Add Makefile targets (build-on-debian-dev, push-multiarch-dev-on-debian) and a GitHub Actions workflow

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docker/utils/check_standalone_config.sh New script to enforce standalone-mode config in config.yaml
docker/debian-dev/install-brotli.sh Script to download, build, install, and clean up Brotli
docker/debian-dev/docker-entrypoint.sh Entrypoint handling standalone vs cluster initialization
docker/debian-dev/Dockerfile Multi-stage build for Debian-based dev image
docker/compose/docker-compose-master.yaml Compose definition for local dev environment
docker/compose/apisix_conf/master/config.yaml Master config for compose-based dev environment
Makefile Targets to build/push Debian-dev and multiarch dev images
.github/workflows/push-dev-image-on-commit.yml CI workflow to build, test, and push apisix:dev on commit
Comments suppressed due to low confidence (2)

docker/debian-dev/install-brotli.sh:22

  • [nitpick] The variable name BORTLI_VERSION is a typo and can be confusing; consider renaming it to BROTL I_VERSION to match the project name and improve readability.
    local BORTLI_VERSION="1.1.0"

docker/utils/check_standalone_config.sh:1

  • [nitpick] This new validation script is untested; consider adding unit or integration tests to verify each error path in check_standalone_config.sh.
#!/usr/bin/env bash

Comment thread Makefile
Comment thread docker/debian-dev/install-brotli.sh
Comment thread .github/workflows/push-dev-image-on-commit.yml

@membphis membphis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

One minor issue, we can fix it later

- apisix

etcd:
image: bitnami/etcd:3.4.9

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the lastest bitnami/etcd is 3.6.*
I think we should update it

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Let's create a issue.

@SkyeYoung
SkyeYoung merged commit 3137d57 into apache:master Jun 12, 2025
42 of 44 checks passed
@SkyeYoung
SkyeYoung deleted the young/feat/workflow/push-dev-image-on-commit branch June 12, 2025 02:24
laz-xyr pushed a commit to laz-xyr/apisix that referenced this pull request Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request github_actions Pull requests that update GitHub Actions code size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants