Skip to content

Commit

Permalink
Remove bazel
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Necas <[email protected]>
  • Loading branch information
mnecas committed Jan 20, 2025
1 parent fb9d138 commit fc80e2d
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 77 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/build_push_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
REGISTRY: quay.io
REGISTRY_TAG: ${{ github.head_ref || github.ref_name }}
REGISTRY_ORG: kubev2v
USE_BAZEL_VERSION: 5.4.0
steps:
- name: Check out forkliftci repository
uses: actions/checkout@v3
Expand All @@ -31,15 +30,6 @@ jobs:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Bazel cache
id: bazel-cache
uses: actions/cache@v3
with:
path: ~/.cache/bazel
key: ${{ runner.os }}-bazel-cache-${{ hashFiles('WORKSPACE') }}

#- run: cd forklift/ && bazel sync --configure

# this is required by nbdkit plugin compiler
- run: sudo apt-get install -y nbdkit-plugin-dev

Expand Down
2 changes: 1 addition & 1 deletion build_and_setup_everything_bazel_manually.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ source ./cluster/common.sh
. ./cluster/kind/kind_with_registry.sh

# clone the forklift repo
./cluster/get_forklift_bazel.sh
./cluster/get_forklift.sh

# deploy kubevirt
./cluster/k8s-deploy-kubevirt.sh
Expand Down
91 changes: 36 additions & 55 deletions build_forklift_bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ PROVIDER_NAME=${1:-all}

echo "Building for provider ${PROVIDER_NAME}"





[ ! -d ${FORKLIFT_DIR:-forklift} ] && FORKLIFT_DIR="${SCRIPT_DIR}/forklift"

# verify there is WORKSPACE file
Expand All @@ -27,71 +23,56 @@ export XDG_RUNTIME_DIR="$(mktemp -p /tmp -d xdg-runtime-XXXXXX)"

export REGISTRY=localhost:5001
export REGISTRY_TAG=latest
export REGISTRY_ORG=""
export REGISTRY_ORG="kubev2v"
export CONTAINER_CMD=$(which docker)

# REGISTRY_ORG cannot be empty with docker
if [ "${PROVIDER_NAME}" = "openstack" ]; then
bazel run push-openstack-populator
fi
if [ "${PROVIDER_NAME}" = "ovirt" ]; then
bazel run push-ovirt-populator
fi
if [ "${PROVIDER_NAME}" = "ova" ]; then
bazel run push-ova-provider-server
CONTAINER_RUNTIME="$(basename ${CONTAINER_CMD:-$(command -v podman || command -v docker)})"
if [ ! -z "${XDG_RUNTIME_DIR}" ]; then
PODMAN_AUTH_FILE="${XDG_RUNTIME_DIR}/containers/auth.json"
if [ "${CONTAINER_RUNTIME}" == "podman" ]; then
if [ -e "${PODMAN_AUTH_FILE}" ]; then
DOCKER_CONFIG="$(mktemp -d)"
DOCKER_AUTH_FILE="${DOCKER_CONFIG}/config.json"
cp "${PODMAN_AUTH_FILE}" "${DOCKER_AUTH_FILE}"
export DOCKER_CONFIG
else
unset DOCKER_CONFIG
fi
fi
fi

bazel run push-populator-controller

bazel run push-forklift-api
bazel run push-forklift-controller
bazel run push-forklift-validation
bazel run push-forklift-operator

ACTION_ENV="--action_env CONTROLLER_IMAGE=${REGISTRY}/forklift-controller:${REGISTRY_TAG} \
--action_env VALIDATION_IMAGE=${REGISTRY}/forklift-validation:${REGISTRY_TAG} \
--action_env OPERATOR_IMAGE=${REGISTRY}/forklift-operator:${REGISTRY_TAG} \
--action_env API_IMAGE=${REGISTRY}/forklift-api:${REGISTRY_TAG}"

# if provider is ovirt or openstack, builder populator controller
if [ "${PROVIDER_NAME}" = "ovirt" ] || [ "${PROVIDER_NAME}" = "openstack" ]; then
ACTION_ENV="$ACTION_ENV --action_env POPULATOR_CONTROLLER_IMAGE=${REGISTRY}/populator-controller:${REGISTRY_TAG}"
fi

if [ "${PROVIDER_NAME}" = "ovirt" ]; then
ACTION_ENV="$ACTION_ENV --action_env OVIRT_POPULATOR_IMAGE=${REGISTRY}/ovirt-populator:${REGISTRY_TAG}"
make push-ovirt-populator-image \
push-populator-controller-image push-api-image push-controller-image push-validation-image push-operator-image \
push-operator-bundle-image push-operator-index-image \
OPM_OPTS="--use-http" BUILD_OPT="--network=host"
fi

if [ "${PROVIDER_NAME}" = "openstack" ]; then
ACTION_ENV="$ACTION_ENV --action_env OPENSTACK_POPULATOR_IMAGE=${REGISTRY}/openstack-populator:${REGISTRY_TAG}"
make push-openstack-populator-image \
push-populator-controller-image push-api-image push-controller-image push-validation-image push-operator-image \
push-operator-bundle-image push-operator-index-image \
OPM_OPTS="--use-http" BUILD_OPT="--network=host"
fi

if [ "${PROVIDER_NAME}" = "vsphere" ]; then
ACTION_ENV="$ACTION_ENV --action_env VIRT_V2V_IMAGE=quay.io/kubev2v/forklift-virt-v2v-stub:${REGISTRY_TAG} \
--action_env VIRT_V2V_DONT_REQUEST_KVM=true "
make push-ovirt-populator-image \
push-populator-controller-image push-api-image push-controller-image push-validation-image push-operator-image \
push-operator-bundle-image push-operator-index-image \
OPM_OPTS="--use-http" BUILD_OPT="--network=host" VIRT_V2V_IMAGE=quay.io/kubev2v/forklift-virt-v2v-stub:latest
fi

if [ "${PROVIDER_NAME}" = "ova" ]; then
ACTION_ENV="$ACTION_ENV --action_env VIRT_V2V_IMAGE=quay.io/kubev2v/forklift-virt-v2v-stub:${REGISTRY_TAG} \
--action_env VIRT_V2V_DONT_REQUEST_KVM=true \
--action_env OVA_PROVIDER_SERVER_IMAGE=${REGISTRY}/forklift-ova-provider-server:${REGISTRY_TAG}"
make push-ova-provider-server-image \
push-populator-controller-image push-api-image push-controller-image push-validation-image push-operator-image \
push-operator-bundle-image push-operator-index-image \
OPM_OPTS="--use-http" BUILD_OPT="--network=host" VIRT_V2V_IMAGE=quay.io/kubev2v/forklift-virt-v2v-stub:latest
fi

if [ "${PROVIDER_NAME}" = "all" ]; then
ACTION_ENV="$ACTION_ENV --action_env VIRT_V2V_IMAGE=quay.io/kubev2v/forklift-virt-v2v-stub:${REGISTRY_TAG} \
--action_env VIRT_V2V_DONT_REQUEST_KVM=true \
--action_env OVIRT_POPULATOR_IMAGE=${REGISTRY}/ovirt-populator:${REGISTRY_TAG} \
--action_env OPENSTACK_POPULATOR_IMAGE=${REGISTRY}/openstack-populator:${REGISTRY_TAG} \
--action_env POPULATOR_CONTROLLER_IMAGE=${REGISTRY}/populator-controller:${REGISTRY_TAG} \
--action_env OVA_PROVIDER_SERVER_IMAGE=${REGISTRY}/forklift-ova-provider-server:${REGISTRY_TAG}"
fi

bazel run push-forklift-operator-bundle \
--action_env CONTROLLER_IMAGE=${REGISTRY}/forklift-controller:${REGISTRY_TAG} \
--action_env VALIDATION_IMAGE=${REGISTRY}/forklift-validation:${REGISTRY_TAG} \
--action_env OPERATOR_IMAGE=${REGISTRY}/forklift-operator:${REGISTRY_TAG} \
--action_env API_IMAGE=${REGISTRY}/forklift-api:${REGISTRY_TAG} \
${ACTION_ENV}

bazel run push-forklift-operator-index --action_env REGISTRY=${REGISTRY} --action_env REGISTRY_TAG=${REGISTRY_TAG} --action_env OPM_OPTS="--use-http"

if [ "${PROVIDER_NAME}" = "all" ] || [ "${PROVIDER_NAME}" = "" ]; then
make push-ova-provider-server-image push-ovirt-populator-image push-openstack-populator-image push-ovirt-populator-image\
push-populator-controller-image push-api-image push-controller-image push-validation-image push-operator-image \
push-operator-bundle-image push-operator-index-image \
OPM_OPTS="--use-http" BUILD_OPT="--network=host" VIRT_V2V_IMAGE=quay.io/kubev2v/forklift-virt-v2v-stub:latest
fi
9 changes: 1 addition & 8 deletions ci/build-and-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ runs:
repository: kubev2v/forklift
path: forklift

- name: Bazel cache
id: bazel-cache
uses: actions/cache@v3
with:
path: ~/.cache/bazel
key: ${{ runner.os }}-bazel-cache-${{ hashFiles('forklift/WORKSPACE') }}

- run: echo "${{ github.action_path }}" >> $GITHUB_PATH
shell: bash

Expand All @@ -49,7 +42,7 @@ runs:
env:
GH_TOKEN: ${{ inputs.gh_access_token }}

- name: Build and setup everything with bazel
- name: Build and setup everything
shell: bash
run: |
echo $GITHUB_WORKSPACE
Expand Down
1 change: 1 addition & 0 deletions cluster/deploy_local_forklift_bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ spec:
validation_container_requests_cpu: "50m"
controller_container_requests_cpu: "50m"
api_container_requests_cpu: "50m"
virt_v2v_dont_request_kvm: true
EOF
File renamed without changes.
1 change: 1 addition & 0 deletions cluster/k8s-deploy-forklift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ spec:
validation_tls_enabled: false
must_gather_api_tls_enabled: false
ui_tls_enabled: false
virt_v2v_dont_request_kvm: true
EOF

echo Forklift: $FORK_RELEASE
2 changes: 1 addition & 1 deletion cluster/kind/kind_with_registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ echo "Running $0"
set -o errexit
[ -z "${REMOTE_DOCKER_HOST}" ] || . ./cluster/kind/setup_remote_docker_kind.sh

go install sigs.k8s.io/kind@v0.15.0
go install sigs.k8s.io/kind@v0.26.0

[ "$(type -P kind)" ] || ( echo "kind is not in PATH" ; exit 2 )

Expand Down
2 changes: 1 addition & 1 deletion cluster/manifests/forklift-k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
displayName: Forklift Operator
publisher: Konveyor
sourceType: grpc
image: localhost:5001/forklift-operator-index:latest
image: localhost:5001/kubev2v/forklift-operator-index:latest
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
Expand Down
1 change: 1 addition & 0 deletions cluster/okd-on-ovirt/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ spec:
inventory_tls_enabled: true
validation_tls_enabled: false
must_gather_api_tls_enabled: false
virt_v2v_dont_request_kvm: true
ui_tls_enabled: false
EOF

Expand Down
2 changes: 1 addition & 1 deletion setup_everything.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

. ./kind/install_kind.sh
. ./cluster/kind/install_kind.sh

./cluster/k8s-deploy-forklift.sh

Expand Down

0 comments on commit fc80e2d

Please sign in to comment.