-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: reduce number of containers #243
Conversation
build/Dockerfile.DiskVirt
Outdated
USER_NAME=${TASK_NAME} \ | ||
HOME=/home/${TASK_NAME} | ||
|
||
USER 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is overriden in L34?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the libguestfs does not allow to do user modifications without switching to root. Then on line 34 it is switched back to regular user
build/Dockerfile.DiskVirt
Outdated
CGO_ENABLED=0 GOOS=linux go build -o /out/${TASK_NAME} cmd/${TASK_NAME}/main.go; \ | ||
done | ||
|
||
FROM quay.io/kubevirt/libguestfs-tools:v0.59.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the kubevirt version a variable?
3e1e8f8
to
1887193
Compare
project kubevirt tekton tasks project will use only 2 containers - kubevirt/kubevirt-tekton-tasks#243. This commit adjusts settings for openshift ci Signed-off-by: Karel Šimon <ksimon@redhat.com>
…38645) project kubevirt tekton tasks project will use only 2 containers - kubevirt/kubevirt-tekton-tasks#243. This commit adjusts settings for openshift ci Signed-off-by: Karel Šimon <ksimon@redhat.com>
/retest |
1 similar comment
/retest |
43bcf85
to
cb8f09e
Compare
/hold WIP |
a9d8974
to
aa31216
Compare
/hold cancel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's really nitpicky but I'd like if both Containerfiles were kept as similar as possible.
@@ -191,7 +193,7 @@ spec: | |||
description: The namespace of a VM that was created. | |||
steps: | |||
- name: createvm | |||
image: "quay.io/kubevirt/tekton-task-create-vm:v0.14.0" | |||
image: "quay.io/kubevirt/tekton-tasks:v0.14.0" | |||
command: | |||
- create-vm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not using entrypoint
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tasks do not need a user modifications.
Another problem is, that the entrypoint is doing some nasty things with quotation marks of parameters and e.g. modify-template task has problem with it.
command: | ||
- entrypoint | ||
args: | ||
- '--verbose' | ||
- $(params.verbose) | ||
env: | ||
- name: COMMAND |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need the COMMAND
env or could the command to be executed be the first arg in a step?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried both approaches, but I like this one better because I don't know if the arguments are guaranteed in the order. Through the env variable, it is always certain that the command will be there.
aa31216
to
0d9d84a
Compare
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 0xFelix, ksimon1 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…penshift#38645) project kubevirt tekton tasks project will use only 2 containers - kubevirt/kubevirt-tekton-tasks#243. This commit adjusts settings for openshift ci Signed-off-by: Karel Šimon <ksimon@redhat.com>
What this PR does / why we need it:
feat: reduce number of containers
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
Release note: