From f5bfebc45890837b3e284e937ab8e954ef7f732b Mon Sep 17 00:00:00 2001 From: erwinvaneyk Date: Tue, 17 Jul 2018 17:23:22 +0200 Subject: [PATCH] Updated compiling instructions and renamed potential conflicting wfcli directory --- .gitignore | 10 ++++-- build/docker.sh | 2 +- build/{wfcli => wfcli-docker}/Dockerfile | 0 compiling.md | 43 +++++++++++++++++------- 4 files changed, 40 insertions(+), 15 deletions(-) rename build/{wfcli => wfcli-docker}/Dockerfile (100%) diff --git a/.gitignore b/.gitignore index 0be1a88c..2bf14b77 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,12 @@ __pycache__/ revive.toml +wfcli +wfcli-linux +wfcli-osx +wfcli-windows -wfcli* -fission-workflows-bundle* \ No newline at end of file +fission-workflows-bundle +fission-workflows-bundle-linux +fission-workflows-bundle-osx +fission-workflows-bundle-windows \ No newline at end of file diff --git a/build/docker.sh b/build/docker.sh index deb5c415..6f3abe9e 100755 --- a/build/docker.sh +++ b/build/docker.sh @@ -42,7 +42,7 @@ docker build --tag="${IMAGE_REPO}/workflow-build-env:${IMAGE_TAG}" ${BUILD_ROOT} --build-arg BUNDLE_IMAGE=${bundleImage} \ --build-arg BUNDLE_TAG=${IMAGE_TAG} echo "Building wfcli..." -docker build --tag="${IMAGE_REPO}/wfcli:${IMAGE_TAG}" ${BUILD_ROOT}/wfcli/ \ +docker build --tag="${IMAGE_REPO}/wfcli-docker:${IMAGE_TAG}" ${BUILD_ROOT}/wfcli/ \ --no-cache \ --build-arg BUNDLE_IMAGE=${bundleImage} \ --build-arg BUNDLE_TAG=${IMAGE_TAG} diff --git a/build/wfcli/Dockerfile b/build/wfcli-docker/Dockerfile similarity index 100% rename from build/wfcli/Dockerfile rename to build/wfcli-docker/Dockerfile diff --git a/compiling.md b/compiling.md index 91d1f886..b74f6452 100644 --- a/compiling.md +++ b/compiling.md @@ -4,35 +4,54 @@ just deploying Fission Workflows, use the helm chart which points to prebuilt images by default.* -## Requirements +## Compilation +There are two ways to compiling the environment: locally or in Docker. Regardless of the approach, ensure that your +environment meets all prerequisite requirements, and checkout the repo from github. + +### Local Compilation + +#### Requirements - go >1.8 - docker - [glide](http://glide.sh/) package manager -## Compilation -Ensure that your environment meets all prerequisite requirements, and checkout the repo from github. - ```bash # Install dependencies -glide install +glide install -v -cd build -bash ./build-linux.sh +# Build the artifacts: wfcli, fission-workflows-bundle +build/build-linux.sh -# Optional: Ensure that you target the right docker registry (assuming minikube) -eval $(minikube docker-env) +# Build the docker images (the NOBUILD parameter indicates that Docker should use the artifacts (wfci, +# fission-workflows-bundle) you just build with build/build-linux.sh) +NOBUILD=y build/docker.sh fission latest +``` -# Build the docker images -bash ./docker.sh fission latest +### In-Docker Compilation + +THe in-Docker compilation approach builds all artifacts in Docker containers. The advantage of this is that builds +are not affected by the environment differences of your local machine and limits the need to install build tooling on +your machine (except for Docker). This comes at the cost of performance: builds are started completely clean +every time; dependencies, intermediate build steps and artifacts are not cached. + +While the local compilation is most convenient for developing and testing Fission Workflows, In-Docker compilation +should be used for building the official/final images. + +```bash +# Build the docker images (the absence of the NOBUILD parameter indicates that Docker should first build the artifacts +# in a Docker container) +build/docker.sh ``` +## Deployment + To deploy your locally compiled version. **As of writing Fission Workflows, requires fission to be installed in the fission namespace.** ```bash helm install --set "tag=latest" --namespace fission charts/fission-workflows ``` -### CLI +## Optional: CLI There is an experimental CLI available, called `wfcli`. The intent is to integrate it into the Fission CLI, removing the need for the separate CLI. ```bash