-
Notifications
You must be signed in to change notification settings - Fork 290
🌱 Fix hack/ci-e2e.sh script installations #2699
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,16 +45,20 @@ export E2E_BMCS_CONF_FILE="${REPO_ROOT}/test/e2e/config/bmcs-${BMC_PROTOCOL}.yam | |
| ;; | ||
| esac | ||
|
|
||
| sudo apt-get update | ||
| sudo apt-get install -y build-essential tar | ||
|
|
||
| # Ensure requirements are installed | ||
| export PATH="/usr/local/go/bin:${PATH}" | ||
| "${REPO_ROOT}/hack/e2e/ensure_go.sh" | ||
| "${REPO_ROOT}/hack/e2e/ensure_htpasswd.sh" | ||
| # CAPI test framework uses kubectl in the background | ||
| "${REPO_ROOT}/hack/e2e/ensure_kubectl.sh" | ||
| "${REPO_ROOT}/hack/e2e/ensure_yq.sh" | ||
| "${REPO_ROOT}/hack/e2e/ensure_docker.sh" | ||
|
|
||
| sudo apt-get update | ||
| sudo apt-get install -y libvirt-dev pkg-config | ||
| sudo apt-get install -y libvirt-daemon-system qemu-kvm virt-manager libvirt-dev | ||
| make build | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might be repetition with L82, but this does some necessary steps also, just might slow down the script |
||
|
|
||
| # Build the container image with e2e tag (used in tests) | ||
| IMG=quay.io/metal3-io/baremetal-operator:e2e make docker | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #!/usr/bin/env bash | ||
| # shellcheck disable=SC1091 | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added this to fix the shellcheck issue, this code is from the official installation instructions of installing Docker Engine on Ubuntu. |
||
|
|
||
| set -eux | ||
|
|
||
| # Check if docker is installed and install it if not. | ||
| # This is optimized to install on Ubuntu. | ||
| # The `newgrp` will stop a non-interactive script run. | ||
| verify_docker() | ||
| { | ||
| if ! [[ -x "$(command -v docker)" ]]; then | ||
| if [[ "${OSTYPE}" == "linux-gnu" ]] && [[ "$(. /etc/os-release && echo "${ID}")" == "ubuntu" ]]; then | ||
| echo "docker not found, installing" | ||
| sudo apt-get install ca-certificates | ||
| sudo install -m 0755 -d /etc/apt/keyrings | ||
| sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc | ||
| sudo chmod a+r /etc/apt/keyrings/docker.asc | ||
| echo \ | ||
| "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ | ||
| $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \ | ||
sirpaleet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
| sudo apt-get update | ||
| sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | ||
| sudo usermod -aG docker "${USER}" | ||
| newgrp docker | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does nothing
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm confused as to which part, since it works for me? The new docker group? |
||
| else | ||
| echo "Missing required binary in path: docker" | ||
| return 2 | ||
| fi | ||
| fi | ||
| } | ||
|
|
||
| verify_docker | ||
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 not descriptive name for the target... setup-e2e or such would be nicer
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 agree the naming is a bit clunky, it's just that the "setup" would imply installations and anything more vague would imply it is used in actual e2e runs elsewhere no? Or maybe not?