-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: reduce number of dockerfiles this commit reduces number of builded containers to just 2. One container for disk-virt tasks and second for everything else. The disk-virt containers requires separate container, because they need different base image (kubevirt libguestfs which is distroless and we can't install there anything). Other tasks share the same container, because they don't need anything special. This change will help to decrease maintenance effort, because we will not have to take care about 9 containers, but only about two. This commit also reduce number of dockerfiles to just two (one for disk-virt tasks, second for everything else). This will help to reduce time needed to e.g. bump golang version, or bump base images versions. It will also reduce complexity of build scripts and it will reduce build time. New containers will have names: kubevirt/tekton-tasks kubevirt/tekton-tasks-disk-virt kubevirt/tekton-tasks container contains :copy-template, create-vm, execute-in-vm, generate-ssh-keys, modify-data-object, modify-vm-template and wait-for-vmi-status tasks. kubevirt/tekton-tasks-disk-virt container contains: disk-virt-customize and disk-virt-sysprep Signed-off-by: Karel Šimon <ksimon@redhat.com>
- Loading branch information
Showing
78 changed files
with
229 additions
and
989 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM quay.io/centos/centos:stream9 AS builder | ||
RUN dnf install -y tar gzip && dnf clean all | ||
ENV GO_VERSION="1.20.2" | ||
|
||
RUN curl -L https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz | tar -C /usr/local -xzf - | ||
ENV PATH=$PATH:/usr/local/go/bin | ||
|
||
COPY . /src | ||
RUN mkdir /out | ||
|
||
RUN task_names=("copy-template" "create-vm" "execute-in-vm" "generate-ssh-keys" "modify-data-object" "modify-vm-template" "wait-for-vmi-status"); \ | ||
for TASK_NAME in ${task_names[@]}; do \ | ||
cd /src/modules/$TASK_NAME/; \ | ||
CGO_ENABLED=0 GOOS=linux go build -mod=vendor -o /out/${TASK_NAME} cmd/${TASK_NAME}/main.go; \ | ||
done | ||
|
||
FROM quay.io/centos/centos:stream9 | ||
ENV TASK_NAME=tekton-tasks \ | ||
USER_UID=1001 \ | ||
USER_NAME=${TASK_NAME} \ | ||
HOME=/home/${TASK_NAME} | ||
|
||
RUN dnf install -y xorriso openssh-clients && dnf clean all | ||
# install task binaries | ||
COPY --from=builder /out/. /usr/local/bin/ | ||
|
||
COPY build/bin /usr/local/bin | ||
|
||
USER 0 | ||
RUN /usr/local/bin/user_setup | ||
|
||
ENTRYPOINT ["/usr/local/bin/entrypoint"] | ||
CMD ["--help"] | ||
|
||
USER ${USER_UID} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM quay.io/centos/centos:stream9 AS taskBuilder | ||
|
||
RUN dnf install -y tar gzip && dnf clean all | ||
|
||
ENV GO_VERSION="1.20.2" | ||
|
||
RUN curl -L https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz | tar -C /usr/local -xzf - | ||
ENV PATH=$PATH:/usr/local/go/bin | ||
|
||
COPY . /src | ||
RUN mkdir /out | ||
|
||
RUN task_names=("disk-virt-customize" "disk-virt-sysprep"); \ | ||
for TASK_NAME in ${task_names[@]}; do \ | ||
cd /src/modules/$TASK_NAME/; \ | ||
CGO_ENABLED=0 GOOS=linux go build -mod=vendor -o /out/${TASK_NAME} cmd/${TASK_NAME}/main.go; \ | ||
done | ||
|
||
FROM quay.io/kubevirt/libguestfs-tools:v0.59.0 | ||
ENV TASK_NAME=disk-virt | ||
ENV USER_UID=1001 \ | ||
USER_NAME=${TASK_NAME} \ | ||
HOME=/home/${TASK_NAME} | ||
|
||
# install task binaries | ||
COPY --from=taskBuilder /out/. /usr/local/bin/ | ||
COPY build/bin /usr/local/bin | ||
|
||
USER 0 | ||
RUN /usr/local/bin/user_setup | ||
|
||
ENTRYPOINT ["/usr/local/bin/entrypoint"] | ||
CMD ["--help"] | ||
|
||
USER ${USER_UID} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
task_name: cleanup-vm | ||
task_category: execute-in-vm | ||
# execute-in-vm.yaml main_image should be also updated to match this one! | ||
main_image: quay.io/kubevirt/tekton-task-execute-in-vm | ||
main_image: quay.io/kubevirt/tekton-tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
task_name: copy-template | ||
task_category: copy-template | ||
main_image: quay.io/kubevirt/tekton-task-copy-template | ||
main_image: quay.io/kubevirt/tekton-tasks | ||
is_okd: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
task_name: create-vm-from-manifest | ||
task_category: create-vm | ||
# create-vm-from-template.yaml main_image should be also updated to match this one! | ||
main_image: quay.io/kubevirt/tekton-task-create-vm | ||
main_image: quay.io/kubevirt/tekton-tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
task_name: create-vm-from-template | ||
task_category: create-vm | ||
# create-vm-from-manifest.yaml main_image should be also updated to match this one! | ||
main_image: quay.io/kubevirt/tekton-task-create-vm | ||
main_image: quay.io/kubevirt/tekton-tasks | ||
is_okd: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
task_name: disk-virt-customize | ||
task_category: disk-virt-customize | ||
main_image: quay.io/kubevirt/tekton-task-disk-virt-customize | ||
main_image: quay.io/kubevirt/tekton-task-disk-virt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
task_name: disk-virt-sysprep | ||
task_category: disk-virt-sysprep | ||
main_image: quay.io/kubevirt/tekton-task-disk-virt-sysprep | ||
main_image: quay.io/kubevirt/tekton-task-disk-virt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
task_name: execute-in-vm | ||
task_category: execute-in-vm | ||
# cleanup-vm.yaml main_image should be also updated to match this one! | ||
main_image: quay.io/kubevirt/tekton-task-execute-in-vm | ||
main_image: quay.io/kubevirt/tekton-tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
task_name: generate-ssh-keys | ||
task_category: generate-ssh-keys | ||
main_image: quay.io/kubevirt/tekton-task-generate-ssh-keys | ||
main_image: quay.io/kubevirt/tekton-tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
task_name: modify-data-object | ||
task_category: modify-data-object | ||
main_image: quay.io/kubevirt/tekton-task-modify-data-object | ||
main_image: quay.io/kubevirt/tekton-tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
task_name: modify-object | ||
task_category: modify-object | ||
main_image: quay.io/kubevirt/tekton-task-modify-object | ||
main_image: quay.io/kubevirt/tekton-tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
task_name: modify-vm-template | ||
task_category: modify-vm-template | ||
main_image: quay.io/kubevirt/tekton-task-modify-vm-template | ||
main_image: quay.io/kubevirt/tekton-tasks | ||
is_okd: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
task_name: modify-windows-iso-file | ||
task_category: modify-windows-iso-file | ||
extract_iso_image: quay.io/kubevirt/tekton-task-disk-virt-customize | ||
modify_iso_image: quay.io/kubevirt/tekton-task-modify-data-object | ||
create_iso_image: quay.io/kubevirt/tekton-task-modify-data-object | ||
extract_iso_image: quay.io/kubevirt/tekton-task-disk-virt | ||
modify_iso_image: quay.io/kubevirt/tekton-tasks | ||
create_iso_image: quay.io/kubevirt/tekton-tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
task_name: wait-for-vmi-status | ||
task_category: wait-for-vmi-status | ||
main_image: quay.io/kubevirt/tekton-task-wait-for-vmi-status | ||
main_image: quay.io/kubevirt/tekton-tasks |
35 changes: 24 additions & 11 deletions
35
manifests/kubernetes/kubevirt-tekton-tasks-kubernetes.yaml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.