Skip to content

Commit 843a353

Browse files
committed
feat: remove linting/gen from dockerfile
Signed-off-by: Alessio Pragliola <[email protected]>
1 parent 36ba2cc commit 843a353

File tree

4 files changed

+26
-55
lines changed

4 files changed

+26
-55
lines changed

.github/workflows/build-and-push-image.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
if: env.BUILD_CONTEXT == 'tag'
4545
run: |
4646
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
47+
- uses: ./.github/workflows/prepare.yml
4748
- name: Build and Push Image
4849
shell: bash
4950
run: ./scripts/build_deploy.sh

.github/workflows/build.yml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,6 @@ jobs:
1717
build:
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v4
21-
- name: Setup Go
22-
uses: actions/setup-go@v5
23-
with:
24-
go-version: "1.24"
25-
- name: Set up Python
26-
uses: actions/setup-python@v5
27-
with:
28-
python-version: 3.9
29-
- name: Build
30-
run: make clean build
31-
- name: Check if there are uncommitted file changes
32-
run: |
33-
clean=$(git status --porcelain)
34-
if [[ -z "$clean" ]]; then
35-
echo "Empty git status --porcelain: $clean"
36-
else
37-
echo "Uncommitted file changes detected: $clean"
38-
git diff
39-
exit 1
40-
fi
20+
- uses: ./.github/workflows/prepare.yml
4121
- name: Unit tests
4222
run: make test-cover

.github/workflows/prepare.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
on:
2+
workflow_call
3+
4+
jobs:
5+
prepare:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- name: Setup Go
10+
uses: actions/setup-go@v5
11+
with:
12+
go-version: "1.24"
13+
- name: Prepare
14+
run: make clean build/prepare
15+
- name: Check if there are uncommitted file changes
16+
run: |
17+
clean=$(git status --porcelain)
18+
if [[ -z "$clean" ]]; then
19+
echo "Empty git status --porcelain: $clean"
20+
else
21+
echo "Uncommitted file changes detected: $clean"
22+
git diff
23+
exit 1
24+
fi

Dockerfile

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,44 +22,10 @@ COPY templates/ templates/
2222
COPY patches/ patches/
2323
COPY catalog/ catalog/
2424

25-
###### Dev stage - start ######
26-
# see: https://github.com/kubeflow/model-registry/pull/984#discussion_r2048732415
27-
28-
FROM common AS dev
29-
30-
USER root
31-
32-
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o model-registry
33-
34-
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest AS dev-build
35-
36-
WORKDIR /
37-
COPY --from=dev /workspace/model-registry .
38-
USER 65532:65532
39-
40-
ENTRYPOINT ["/model-registry"]
41-
42-
###### Dev stage - end ######
43-
4425
FROM common AS builder
4526

4627
USER root
47-
# default NodeJS 14 is not enough for openapi-generator-cli, switch to Node JS currently supported
48-
RUN yum remove -y nodejs npm
49-
RUN yum module -y reset nodejs
50-
RUN yum module -y enable nodejs:18
51-
# install npm and java for openapi-generator-cli
52-
RUN yum install -y nodejs npm java-11-headless python3
53-
54-
RUN make deps
55-
56-
# NOTE: The two instructions below are effectively equivalent to 'make clean build'
57-
# DO NOT REMOVE THE 'build/prepare' TARGET!!!
58-
# It ensures consitent repeatable Dockerfile builds
5928

60-
# prepare the build in a separate layer
61-
RUN make clean build/prepare
62-
# compile separately to optimize multi-platform builds
6329
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} make build/compile
6430

6531
# Use distroless as minimal base image to package the model-registry binary

0 commit comments

Comments
 (0)