You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Address race condition in XController variable (#330)
* Update Dockerfile:
* To not to use root user to build
* To allow for passing of golang build args
Updated Makefile:
* To selectively run the generate code
* To allow for passing of golang build args
* Updates to ensure that docker builds flags are used
Update to the e2e script to allow for not caching test runs and cluster setup
* Updates to e2e script and travis for log level
Fixed 1 race condition issue.
* Reverted needless changes.
* Documentation updates.
Minor fixes to make file.
* Fixed bug in docker file
Reduced noise in e2e test.
* Fixed potential regression.
* Added back Dockerfile
This document will show how to build the `Multi-Cluster-App-Deployer` (`MCAD`) Kubernetes Controller that operates on an `AppWrapper` kubernetes custom resource definition. Instructions are for the [master](https://github.com/IBM/multi-cluster-app-dispatcher/tree/master) branch.
3
+
This document will show how to build the `Multi-Cluster-App-Dispatcher` (`MCAD`) Kubernetes Controller that operates on an `AppWrapper` kubernetes custom resource definition. Instructions are for the [main](https://github.com/project-codeflare/multi-cluster-app-dispatcher/tree/main) branch.
4
4
5
5
## 1. Pre-condition
6
6
7
7
### Docker Environment
8
8
9
-
To build `Multi-Cluster-App-Deployer`, a running Docker environment must be available. Here is a document on [Getting Started with Docker](https://www.docker.com/get-started).
9
+
To build `Multi-Cluster-App-Dispatcher`, a running Docker environment must be available. Here is a document on [Getting Started with Docker](https://www.docker.com/get-started). Podman image builds are also supported.
10
10
11
11
### Clone Multi-Cluster-App-Deployer Git Repo
12
12
@@ -36,8 +36,8 @@ $
36
36
37
37
To build the controller and to run the end to end tests locally you will need to have the following software installed:
38
38
39
-
*`Go` (version 1.16) -- the controller will compile and run with later versions, but currently supported version is 1.16
40
-
*`kind` (version 0.11) -- later versions will work fine
39
+
*`Go` (version 1.18)
40
+
*`kind` (version 0.18)
41
41
*`kubectl`
42
42
*`helm` - version 3.0 or later
43
43
*`make`
@@ -56,30 +56,25 @@ To to build the executable, execute:
56
56
#build for linux OS and for use inside docker image
57
57
multi-cluster-app-dispatcher $ make mcad-controller
58
58
...
59
-
Compiling deepcopy-gen...
60
-
Generating deepcopy...
61
-
go build -o _output/bin/deepcopy-gen ./cmd/deepcopy-gen/
go build -race -o _output/bin/mcad-controller-local ./cmd/kar-controllers/
61
+
CGO_ENABLED=0 go build -o _output/bin/mcad-controller ./cmd/kar-controllers/
76
62
```
77
63
78
-
Ensure the executables: `deepcopy-gen` and`mcad-controllers` are created in the target output directory:
64
+
Ensure the executable`mcad-controllers` are created in the target output directory:
79
65
80
66
```bash
81
67
multi-cluster-app-dispatcher $ ls _output/bin
82
-
deepcopy-gen mcad-controller
68
+
mcad-controller
69
+
```
70
+
71
+
If you want pass additional args to the `go build`, define add them to the `GO_BUILD_ARGS` environment variable. This feature is useful if you want to compile the executable with the race condition detector turned on. To turn on the the race detector in your executable, execute:
72
+
73
+
```bash
74
+
make mcad-controller GO_BUILD_ARGS=-race
75
+
mkdir -p _output/bin
76
+
Compiling controller with build arguments: '-race'
77
+
go build -race -o _output/bin/mcad-controller ./cmd/kar-controllers/
83
78
```
84
79
85
80
### Build the Multi-Cluster-App-Dispatcher Image
@@ -92,22 +87,22 @@ From the root directory of the repository:
92
87
# With docker daemon running
93
88
multi-cluster-app-dispatcher % make images
94
89
....
95
-
# output from main branch, MacOS build, local file names replaced with XXXXXXXXXX
90
+
make images
96
91
"---"
97
92
"MAKE GLOBAL VARIABLES:"
98
93
""BIN_DIR="_output/bin"
99
94
""GIT_BRANCH="main"
100
-
""RELEASE_VER="v1.29.55"
101
-
""TAG="main-v1.29.55"
95
+
""RELEASE_VER="v1.29.57"
96
+
""TAG="main-v1.29.57"
97
+
""GO_BUILD_ARGS=""
102
98
"---"
103
99
# Check for invalid tag name
104
-
t=main-v1.29.55&& [ ${#t}-le 128 ] || { echo"Target name $t has 128 or more chars";false; }
100
+
t=main-v1.29.57&& [ ${#t}-le 128 ] || { echo"Target name $t has 128 or more chars";false; }
The `GO_BUILD_ARGS` use is also supported by the images builds with either `docker` and `podman`. To turn on the race condition detector in image's executable execute: `make images GO_BUILD_ARGS=-race`
129
+
137
130
### Push the Multi-Cluster-App-Dispatcher Image to an Image Repository
138
131
139
132
The following example assumes an available `<repository>/mcad-controller` on [Docker Hub](https://hub.docker.com) and using image version `v1.14`
# Using older image due to older version of kubernetes cluster"
@@ -334,7 +334,7 @@ function kube-test-env-up {
334
334
# start mcad controller
335
335
echo"Starting MCAD Controller..."
336
336
echo"helm install mcad-controller namespace kube-system wait set loglevel=2 set resources.requests.cpu=1000m set resources.requests.memory=1024Mi set resources.limits.cpu=4000m set resources.limits.memory=4096Mi set image.repository=$IMAGE_REPOSITORY_MCAD set image.tag=$IMAGE_TAG_MCAD set image.pullPolicy=$MCAD_IMAGE_PULL_POLICY"
0 commit comments