Skip to content

Commit ea18fcc

Browse files
committed
Documentation updates.
Minor fixes to make file.
1 parent 95c0f95 commit ea18fcc

File tree

2 files changed

+33
-40
lines changed

2 files changed

+33
-40
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ifeq ($(strip $(GO_BUILD_ARGS)),)
3535
$(info Compiling controller)
3636
CGO_ENABLED=0 go build -o ${BIN_DIR}/mcad-controller ./cmd/kar-controllers/
3737
else
38-
$(info Compling controller with build arguments: '${GO_BUILD_ARGS}')
38+
$(info Compiling controller with build arguments: '${GO_BUILD_ARGS}')
3939
go build $(GO_BUILD_ARGS) -o ${BIN_DIR}/mcad-controller ./cmd/kar-controllers/
4040
endif
4141

@@ -63,7 +63,7 @@ verify-tag-name: print-global-variables
6363

6464
generate-code: pkg/apis/controller/v1beta1/zz_generated.deepcopy.go
6565

66-
pkg/apis/controller/v1beta1/zz_generated.deepcopy.go:
66+
pkg/apis/controller/v1beta1/zz_generated.deepcopy.go: ${BIN_DIR}/deepcopy-gen
6767
$(info Generating deepcopy...)
6868
${BIN_DIR}/deepcopy-gen -i ./pkg/apis/controller/v1beta1/ -O zz_generated.deepcopy
6969

doc/build/build.md

Lines changed: 31 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Multi-Cluster-App-Dispatcher Controller Build Instructions
22

3-
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.
44

55
## 1. Pre-condition
66

77
### Docker Environment
88

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.
1010

1111
### Clone Multi-Cluster-App-Deployer Git Repo
1212

@@ -36,8 +36,8 @@ $
3636
3737
To build the controller and to run the end to end tests locally you will need to have the following software installed:
3838
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)
4141
* `kubectl`
4242
* `helm` - version 3.0 or later
4343
* `make`
@@ -56,30 +56,25 @@ To to build the executable, execute:
5656
#build for linux OS and for use inside docker image
5757
multi-cluster-app-dispatcher $ make mcad-controller
5858
...
59-
Compiling deepcopy-gen...
60-
Generating deepcopy...
61-
go build -o _output/bin/deepcopy-gen ./cmd/deepcopy-gen/
62-
_output/bin/deepcopy-gen -i ./pkg/apis/controller/v1beta1/ -O zz_generated.deepcopy
63-
Compiling controller
64-
CGO_ENABLED=0 GOOS="linux" go build -o _output/bin/mcad-controller ./cmd/kar-controllers/
65-
66-
#build for local testing purposes, by default enable the race conditions detector
67-
multi-cluster-app-dispatcher $ make mcad-controller-local
68-
...
6959
mkdir -p _output/bin
70-
Compiling deepcopy-gen...
71-
Generating deepcopy...
72-
go build -o _output/bin/deepcopy-gen ./cmd/deepcopy-gen/
73-
_output/bin/deepcopy-gen -i ./pkg/apis/controller/v1beta1/ -O zz_generated.deepcopy
7460
Compiling controller
75-
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/
7662
```
7763
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:
7965
8066
```bash
8167
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/
8378
```
8479
8580
### Build the Multi-Cluster-App-Dispatcher Image
@@ -92,22 +87,22 @@ From the root directory of the repository:
9287
# With docker daemon running
9388
multi-cluster-app-dispatcher % make images
9489
....
95-
# output from main branch, MacOS build, local file names replaced with XXXXXXXXXX
90+
make images
9691
"---"
9792
"MAKE GLOBAL VARIABLES:"
9893
" "BIN_DIR="_output/bin"
9994
" "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=""
10298
"---"
10399
# 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; }
105101
List executable directory
106102
repo id:
107103
branch: main
108104
Build the docker image
109-
docker build --quiet --no-cache --tag mcad-controller:main-v1.29.55 -f XXXXXXXXXX/multi-cluster-app-dispatcher/Dockerfile XXXXXXXXXX/multi-cluster-app-dispatcher
110-
sha256:6871c150701280abc29baa14aa639791cefb9ba4b61177ab4faf5a43bdfcc4e4
105+
docker build --quiet --no-cache --tag mcad-controller:main-v1.29.57 -f XXXXXX/multi-cluster-app-dispatcher/Dockerfile XXXXX/multi-cluster-app-dispatcher
111106
112107
#Using podman
113108
make images-podman
@@ -117,37 +112,35 @@ make images-podman
117112
"MAKE GLOBAL VARIABLES:"
118113
" "BIN_DIR="_output/bin"
119114
" "GIT_BRANCH="main"
120-
" "RELEASE_VER="v1.29.55"
121-
" "TAG="main-v1.29.55"
115+
" "RELEASE_VER="v1.29.57"
116+
" "TAG="main-v1.29.57"
117+
" "GO_BUILD_ARGS=""
122118
"---"
123119
# Check for invalid tag name
124-
t=main-v1.29.55 && [ ${#t} -le 128 ] || { echo "Target name $t has 128 or more chars"; false; }
120+
t=main-v1.29.57 && [ ${#t} -le 128 ] || { echo "Target name $t has 128 or more chars"; false; }
125121
List executable directory
126122
repo id:
127123
branch: main
128124
Build the docker image
129-
ls -l XXXXXXXXXX/multi-cluster-app-dispatcher/_output/bin
130-
total 130144
131-
-rwxr-xr-x 1 laurentiu.bradin staff 8238498 Apr 6 15:19 deepcopy-gen
132-
-rwxr-xr-x 1 laurentiu.bradin staff 58391090 Apr 6 15:19 mcad-controller
133-
podman build --quiet --no-cache --tag mcad-controller:issue_315_small_changes-v1.29.55 -f XXXXXXXXXX/multi-cluster-app-dispatcher/Dockerfile XXXXXXXXXX/multi-cluster-app-dispatcher
134-
f784707e8982399ef7ef66e3d8a09b669e6deb17990d174400338813fb13c505
125+
podman build --quiet --no-cache --tag mcad-controller:main-v1.29.57 -f XXXXX/multi-cluster-app-dispatcher/Dockerfile XXXXX/multi-cluster-app-dispatcher
135126
```
136127
128+
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+
137130
### Push the Multi-Cluster-App-Dispatcher Image to an Image Repository
138131
139132
The following example assumes an available `<repository>/mcad-controller` on [Docker Hub](https://hub.docker.com) and using image version `v1.14`
140133
141134
```bash
142135
docker login
143-
docker push <respository>/mcad-controller:v1.14
136+
docker push <repository>/mcad-controller:v1.14
144137
```
145138
146139
The same can be done with [Quay](quay.io)
147140
148141
```bash
149142
docker login quay.io
150-
docker push <quay_respository>/mcad-controller:v1.14
143+
docker push <quay_repository>/mcad-controller:v1.14
151144
```
152145
153146
Refer to [deployment](../deploy/deployment.md) on how to deploy the `multi-cluster-app-dispatcher` as a controller in Kubernetes.

0 commit comments

Comments
 (0)