-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ubi9 and add ubi9-based developer image (#190)
Update ubi9 and udi9 to resemble base/ubi8/Dockerfile and universal/ubi8/Dockerfile Signed-off-by: David Kwon <[email protected]>
- Loading branch information
Showing
11 changed files
with
755 additions
and
10 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
116 changes: 116 additions & 0 deletions
116
.github/workflows/empty-worksapce-smoke-test-on-minikube-ubi9.yaml
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,116 @@ | ||
# | ||
# Copyright (c) 2019-2024 Red Hat, Inc. | ||
# This program and the accompanying materials are made | ||
# available under the terms of the Eclipse Public License 2.0 | ||
# which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
# Contributors: | ||
# Red Hat, Inc. - initial API and implementation | ||
# | ||
|
||
name: Empty workspace smoke test on udi9 | ||
on: | ||
pull_request: | ||
paths-ignore: | ||
- '**/*.md' | ||
- .devfile.yaml | ||
- LICENSE | ||
- 'base/ubi8/**' | ||
- 'universal/ubi8/**' | ||
|
||
env: | ||
USERSTORY: CloneGitRepoAPI | ||
TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL: kubectl | ||
DEPLOYMENT_TIMEOUT: 90s | ||
PULL_POLICY: IfNotPresent | ||
|
||
jobs: | ||
workspace-api-tests-on-minikube: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@master | ||
- name: Free runner space | ||
run: | | ||
sudo rm -rf /usr/local/lib/android | ||
# obtain the PR number for tegging the image | ||
- name: Get PR number | ||
id: get_pr_number | ||
run: | | ||
pr_number=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') | ||
echo "PR_NUMBER=$pr_number" >> $GITHUB_ENV | ||
echo ">>>>>>>>>>>$pr_number" | ||
- name: Cleanup build-in images | ||
run: | | ||
# remove build-in images from the VM because it is not used | ||
docker rmi -f $(docker images -aq) | ||
- name: Start minikube cluster | ||
id: run-minikube | ||
uses: che-incubator/setup-minikube-action@next | ||
with: | ||
minikube-version: v1.31.0 | ||
|
||
# connect with docker daemon in the minikube and build an image there | ||
# we need to build the image in the minikube because we have just 14 GB of space on the runner | ||
# the UBI have more than 9 GB size this approach saves the disk space | ||
- name: Build base image | ||
run: | | ||
eval $(minikube docker-env) | ||
cd base/ubi9 && docker build -t quay.io/devfile/base-developer-image:ubi9-latest . | ||
- name: Build universal image | ||
run: | | ||
eval $(minikube docker-env) | ||
cd universal/ubi9 && docker build -t quay.io/devfile/universal-developer-image:${{ env.PR_NUMBER }} . | ||
- name: Checkout DWO | ||
uses: actions/checkout@master | ||
with: | ||
repository: devfile/devworkspace-operator | ||
path: devworkspace-operator | ||
|
||
- name: Setup cert manager | ||
run: | | ||
cd devworkspace-operator | ||
make install_cert_manager | ||
kubectl wait deployment -n cert-manager cert-manager --for condition=Available=True --timeout=$DEPLOYMENT_TIMEOUT | ||
kubectl wait deployment -n cert-manager cert-manager-cainjector --for condition=Available=True --timeout=$DEPLOYMENT_TIMEOUT | ||
kubectl wait deployment -n cert-manager cert-manager-webhook --for condition=Available=True --timeout=$DEPLOYMENT_TIMEOUT | ||
- name: Setup DWO | ||
run: | | ||
cd devworkspace-operator | ||
make install | ||
kubectl rollout status deployment -n devworkspace-controller devworkspace-controller-manager --timeout=$DEPLOYMENT_TIMEOUT | ||
kubectl rollout status deployment -n devworkspace-controller devworkspace-webhook-server --timeout=$DEPLOYMENT_TIMEOUT | ||
kubectl wait deployment -n devworkspace-controller devworkspace-webhook-server --for condition=Available=True --timeout=$DEPLOYMENT_TIMEOUT | ||
kubectl wait deployment -n devworkspace-controller devworkspace-controller-manager --for condition=Available=True --timeout=$DEPLOYMENT_TIMEOUT | ||
- name: Check that UDI is presen in the image list | ||
run: | | ||
# we used it for the build above and do not need it anymore. It saves the disk space | ||
minikube image rm quay.io/devfile/base-developer-image:ubi9-latest | ||
minikube image list --format table | ||
- name: Install NodeJs | ||
uses: actions/setup-node@v4 | ||
|
||
- name: Checkout tests codebase | ||
uses: actions/checkout@master | ||
with: | ||
ref: api-test-with-clone-project-without-generating | ||
repository: eclipse/che | ||
path: che | ||
|
||
- name: Run Empty workspace smoke test | ||
run: | | ||
export TS_API_TEST_UDI_IMAGE=quay.io/devfile/universal-developer-image:${{ env.PR_NUMBER }} | ||
cd che/tests/e2e | ||
npm i | ||
npm run driver-less-test | ||
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
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,12 @@ | ||
# .viminfo cannot be a symlink for security reasons | ||
\.viminfo | ||
|
||
# We store bash related files in /home/tooling/ so they aren't overriden if persistUserHome is enabled | ||
# but we don't want them to be symbolic links (or to cause stow conflicts). They will be copied to /home/user/ manually. | ||
\.bashrc | ||
\.bash_profile | ||
|
||
# Ignore absolute symbolic links, as they are not supported by stow | ||
\.krew | ||
\.sdkman | ||
\.local/bin/podman |
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
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 |
---|---|---|
|
@@ -18,4 +18,6 @@ if ! whoami &> /dev/null; then | |
fi | ||
fi | ||
|
||
source kubedock_setup | ||
|
||
exec "$@" |
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,55 @@ | ||
#!/bin/bash | ||
|
||
# Kubedock setup script meant to be run from the entrypoint script. | ||
|
||
LOCAL_BIN=/home/user/.local/bin | ||
ORIGINAL_PODMAN_PATH=${ORIGINAL_PODMAN_PATH:-"/usr/bin/podman.orig"} | ||
PODMAN_WRAPPER_PATH=${PODMAN_WRAPPER_PATH:-"/usr/bin/podman.wrapper"} | ||
|
||
mkdir -p "${LOCAL_BIN}" | ||
|
||
if [ "${KUBEDOCK_ENABLED:-false}" = "true" ]; then | ||
echo | ||
echo "Kubedock is enabled (env variable KUBEDOCK_ENABLED is set to true)." | ||
|
||
SECONDS=0 | ||
KUBEDOCK_TIMEOUT=${KUBEDOCK_TIMEOUT:-10} | ||
until [ -f $KUBECONFIG ]; do | ||
if ((SECONDS > KUBEDOCK_TIMEOUT)); then | ||
break | ||
fi | ||
echo "Kubeconfig doesn't exist yet. Waiting..." | ||
sleep 1 | ||
done | ||
|
||
if [ -f $KUBECONFIG ]; then | ||
echo "Kubeconfig found." | ||
|
||
KUBEDOCK_PARAMS=${KUBEDOCK_PARAMS:-"--reverse-proxy --kubeconfig $KUBECONFIG"} | ||
|
||
echo "Starting kubedock with params \"${KUBEDOCK_PARAMS}\"..." | ||
|
||
kubedock server ${KUBEDOCK_PARAMS} >/tmp/kubedock.log 2>&1 & | ||
|
||
echo "Done." | ||
|
||
echo "Replacing podman with podman-wrapper..." | ||
|
||
ln -f -s "${PODMAN_WRAPPER_PATH}" "${LOCAL_BIN}/podman" | ||
|
||
export TESTCONTAINERS_RYUK_DISABLED="true" | ||
export TESTCONTAINERS_CHECKS_DISABLE="true" | ||
|
||
echo "Done." | ||
echo | ||
else | ||
echo "Could not find Kubeconfig at $KUBECONFIG" | ||
echo "Giving up..." | ||
fi | ||
else | ||
echo | ||
echo "Kubedock is disabled. It can be enabled with the env variable \"KUBEDOCK_ENABLED=true\"" | ||
echo "set in the workspace Devfile or in a Kubernetes ConfigMap in the developer namespace." | ||
echo | ||
ln -f -s "${ORIGINAL_PODMAN_PATH}" "${LOCAL_BIN}/podman" | ||
fi |
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,38 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
PODMAN_ORIGINAL_PATH=${PODMAN_ORIGINAL_PATH:-"/usr/bin/podman.orig"} | ||
KUBEDOCK_SUPPORTED_COMMANDS=${KUBEDOCK_SUPPORTED_COMMANDS:-"run ps exec cp logs inspect kill rm wait stop start"} | ||
|
||
PODMAN_ARGS=( "$@" ) | ||
|
||
TRUE=0 | ||
FALSE=1 | ||
|
||
exec_original_podman() { | ||
exec ${PODMAN_ORIGINAL_PATH} "${PODMAN_ARGS[@]}" | ||
} | ||
|
||
exec_kubedock_podman() { | ||
exec env CONTAINER_HOST=tcp://127.0.0.1:2475 "${PODMAN_ORIGINAL_PATH}" "${PODMAN_ARGS[@]}" | ||
} | ||
|
||
podman_command() { | ||
echo "${PODMAN_ARGS[0]}" | ||
} | ||
|
||
command_is_supported_by_kubedock() { | ||
CMD=$(podman_command) | ||
for SUPPORTED_CMD in $KUBEDOCK_SUPPORTED_COMMANDS; do | ||
if [ "$SUPPORTED_CMD" = "$CMD" ]; then | ||
return $TRUE | ||
fi | ||
done | ||
return ${FALSE} | ||
} | ||
|
||
if command_is_supported_by_kubedock; then | ||
exec_kubedock_podman | ||
else | ||
exec_original_podman | ||
fi |
Oops, something went wrong.