Skip to content

Commit c6fc8ad

Browse files
authored
Updated the go version in go.mod (#316)
* Updated the go version in go.mod Ran `go mod tidy` Updated travis.yml Deleted staled code, disabled the quota manager in the controller. * Added travis changes. * Removed linter install Ported changes to .travis.yml from quota-management-branch * Removed linter install Ported changes to .travis.yml from quota-management-branch * Downgraded go to version 1.18 to allow for use of ubi images. * Added use of docker builder using ubi8 images Makefile updates * Cleaned up the obsolete build scripts Updated documentation Minor changes to makefile * Small fix to the docker file. * More updates to go.mod to fix vulnerabilities * Removed text files. * Yet another text file removal * Small fix to address PR review comments.
1 parent bc8fca0 commit c6fc8ad

23 files changed

+304
-2774
lines changed

.travis.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ services:
99
- docker
1010

1111
go:
12-
- "1.16.3"
12+
- "1.18.10"
1313

1414
go_import_path: github.com/project-codeflare/multi-cluster-app-dispatcher
1515

16-
install:
17-
- go get -u golang.org/x/lint/golint
16+
install: []
17+
1818

1919
before_script:
2020
- export TEST_LOG_LEVEL=4
2121

2222
script:
23-
# - make
23+
- BLUE='\033[34m'
2424
- make mcad-controller
2525
- make run-test
2626
# Process 'make images' when NOT a pull request
@@ -29,4 +29,11 @@ script:
2929
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then unset quay_repository && make images; fi'
3030
# Process 'make push-images' when NOT a pull request
3131
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then make push-images; fi'
32-
- travis_wait 80 make run-e2e
32+
# Run the e2e and handle Travis condition where Travis fails on no output for 10 minutes. No output for 10 minutes
33+
# is fine for our test cases that waits for 10 minutes before requeuing a job. The other workaround was to
34+
# use 'travis_wait n' which unfortunately does not stream output until the very end so monitoring the Travis log
35+
# during runtime is not possible.
36+
- make run-e2e &
37+
- PID=$! && echo -e "${BLUE}make run e2e pid=${PID}"
38+
- while [ -e /proc/${PID} ]; do echo -n "." && sleep 30; done
39+
- wait ${PID}

deployment/Dockerfile.both renamed to Dockerfile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1+
FROM registry.access.redhat.com/ubi8/go-toolset:1.18.10-1 AS BUILDER
2+
USER root
3+
WORKDIR /workdir
4+
5+
COPY Makefile Makefile
6+
COPY go.mod go.mod
7+
COPY go.sum go.sum
8+
COPY cmd cmd
9+
COPY pkg pkg
10+
COPY hack hack
11+
12+
RUN make mcad-controller
13+
114
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
215

3-
ADD mcad-controller /usr/local/bin
16+
COPY --from=BUILDER /workdir/_output/bin/mcad-controller /usr/local/bin
417

518
RUN true \
619
&& microdnf update \

Makefile

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ TAG:=${TAG}${RELEASE_VER}
2727
# Build the controler executalbe for use in docker image build
2828
mcad-controller: init generate-code
2929
$(info Compiling controller)
30-
CGO_ENABLED=0 GOOS="linux" go build -o ${BIN_DIR}/mcad-controller ./cmd/kar-controllers/
30+
CGO_ENABLED=0 go build -o ${BIN_DIR}/mcad-controller ./cmd/kar-controllers/
3131

3232
print-global-variables:
3333
$(info "---")
@@ -56,21 +56,20 @@ generate-code:
5656
$(info Generating deepcopy...)
5757
${BIN_DIR}/deepcopy-gen -i ./pkg/apis/controller/v1beta1/ -O zz_generated.deepcopy
5858

59-
images: verify-tag-name mcad-controller
59+
images: verify-tag-name
6060
$(info List executable directory)
6161
$(info repo id: ${git_repository_id})
6262
$(info branch: ${GIT_BRANCH})
63-
ls -l ${CURRENT_DIR}/_output/bin
6463
$(info Build the docker image)
65-
docker build --quiet --no-cache --tag mcad-controller:${TAG} -f ${CURRENT_DIR}/deployment/Dockerfile.both ${CURRENT_DIR}/_output/bin
64+
docker build --quiet --no-cache --tag mcad-controller:${TAG} -f ${CURRENT_DIR}/Dockerfile ${CURRENT_DIR}
6665

67-
images-podman: verify-tag-name mcad-controller
66+
images-podman: verify-tag-name
6867
$(info List executable directory)
6968
$(info repo id: ${git_repository_id})
7069
$(info branch: ${GIT_BRANCH})
7170
ls -l ${CURRENT_DIR}/_output/bin
7271
$(info Build the docker image)
73-
podman build --quiet --no-cache --tag mcad-controller:${TAG} -f ${CURRENT_DIR}/deployment/Dockerfile.both ${CURRENT_DIR}/_output/bin
72+
podman build --quiet --no-cache --tag mcad-controller:${TAG} -f ${CURRENT_DIR}/Dockerfile ${CURRENT_DIR}
7473

7574
push-images: verify-tag-name
7675
ifeq ($(strip $(quay_repository)),)
@@ -95,7 +94,7 @@ run-test:
9594
$(info Running unit tests...)
9695
hack/make-rules/test.sh $(WHAT) $(TESTS)
9796

98-
run-e2e: mcad-controller verify-tag-name
97+
run-e2e: verify-tag-name
9998
ifeq ($(strip $(quay_repository)),)
10099
echo "Running e2e with MCAD local image: mcad-controller ${TAG} IfNotPresent."
101100
hack/run-e2e-kind.sh mcad-controller ${TAG} IfNotPresent
@@ -104,12 +103,10 @@ else
104103
hack/run-e2e-kind.sh ${quay_repository}/mcad-controller ${TAG}
105104
endif
106105

107-
mcad-controller-private: init generate-code
108-
$(info Compiling controller)
109-
CGO_ENABLED=0 GOARCH=amd64 GOPRIVATE=github.ibm.com/* go build -tags private -modfile ./private.mod -o ${BIN_DIR}/mcad-controller ./cmd/kar-controllers/
110106

111107
# Build the controller executable for use on the local host and using local build args
112-
# the default for local build args is `-race` to turn race detection
108+
# the default for local build args is `-race` to turn race detection, this is not to be used
109+
# inside the docker containers.
113110
mcad-controller-local: init generate-code
114111
$(info Compiling controller)
115112
go build ${LOCAL_BUILD_ARGS} -o ${BIN_DIR}/mcad-controller-local ./cmd/kar-controllers/
@@ -119,4 +116,3 @@ coverage:
119116

120117
clean:
121118
rm -rf _output/
122-
rm -f mcad-controllers

deployment/build-inside-container-private.sh

Lines changed: 0 additions & 31 deletions
This file was deleted.

deployment/build-inside-container.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

deployment/build-podman.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

deployment/build-private.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

deployment/build.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

deployment/image-podman.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

deployment/image.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)