Fix image name and drop tost terminology once for all
This change makes sure that we can produce a Docker image correctly tagged
as opennetworking/sdfabric-onos.
Moreover, we attempt to reduce confusion by dropping entirely the term
tost from the Makefile, README, and scripts. This should improve
maintenability going forward. TOST is now mentioned only to refer to the
onos build profile.
Change-Id: Ia2fdb022423279f15c53c6e101488cb3c937ad82
diff --git a/Dockerfile.tost b/Dockerfile
similarity index 92%
rename from Dockerfile.tost
rename to Dockerfile
index 8fb06eb..3a4516f 100644
--- a/Dockerfile.tost
+++ b/Dockerfile
@@ -16,9 +16,8 @@
ARG DOCKER_TAG
-# We start from an onos image and install the apps.
-# We need at least an onos image built with 'tost' profile
-FROM tost-onos:${DOCKER_TAG} as install
+# We start from a base onos image and install the apps.
+FROM onos-base:${DOCKER_TAG} as install
ARG KARAF_VERSION
ARG LOCAL_APPS
@@ -49,7 +48,7 @@
ARG DOCKER_TAG
# Create the final image coping over the installed applications from the install stage
-FROM tost-onos:${DOCKER_TAG}
+FROM onos-base:${DOCKER_TAG}
ARG KARAF_VERSION
@@ -74,7 +73,7 @@
ARG org_stratumproject_fabric_tna_version=unknown
LABEL org.label-schema.schema-version=1.0 \
- org.label-schema.name=tost \
+ org.label-schema.name=sdfabric-onos \
org.label-schema.version=$org_label_schema_version \
org.label-schema.vcs-url=$org_label_schema_vcs_url \
org.label-schema.vcs-ref=$org_label_schema_vcs_ref \
diff --git a/Makefile b/Makefile
index ba5c4ff..3a7aca6 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@
# Docker related
DOCKER_REGISTRY ?=
-DOCKER_REPOSITORY ?= sdfabric-onos
+DOCKER_REPOSITORY ?= opennetworking/sdfabric-onos
DOCKER_BUILD_ARGS ?=
DOCKER_TAG ?= stable
DOCKER_TAG_BUILD_DATE ?=
@@ -53,25 +53,26 @@
$(error You must define properly the DOCKER_TAG variable)
endif
+FINAL_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}:${DOCKER_TAG}${DOCKER_TAG_PROFILER}${DOCKER_TAG_BUILD_DATE}
+export LOCAL_APPS := local-apps
# Shellcheck related
SHELLCHECK_TAG=v0.7.1
SHELLCHECK_IMAGE=koalaman/shellcheck:${SHELLCHECK_TAG}
# ONOS related
-ONOS_IMAGENAME := tost-onos:${DOCKER_TAG}${DOCKER_TAG_PROFILER}${DOCKER_TAG_BUILD_DATE}
+ONOS_BASE_IMAGENAME := onos-base:${DOCKER_TAG}${DOCKER_TAG_PROFILER}${DOCKER_TAG_BUILD_DATE}
export ONOS_ROOT := $(shell pwd)/onos
ONOS_REPO := https://gerrit.onosproject.org/onos
+# TOST is the old name of SD-Fabric, it stands for Trellis ONOS Stratum Tofino.
+# This profile contains the minimal set of ONOS built-in apps required to control
+# the SD-Fabric stack.
ONOS_PROFILE := "tost"
PROFILER ?=
ONOS_YOURKIT := 2021.3-b230
USE_ONOS_BAZEL_OUTPUT ?=
USE_LOCAL_SNAPSHOT_ARTIFACTS ?=
-# TOST related
-TOST_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}:${DOCKER_TAG}${DOCKER_TAG_PROFILER}${DOCKER_TAG_BUILD_DATE}
-export LOCAL_APPS := local-apps
-
# Trellis-Control related
export TRELLIS_CONTROL_ROOT := $(shell pwd)/trellis-control
export TRELLIS_CONTROL_REPO := https://gerrit.onosproject.org/trellis-control
@@ -242,13 +243,13 @@
fi \
fi
-onos-build: onos ## : Builds the tost-onos docker image
+onos-build: onos ## : Builds the onos-base docker image
rm -rf .onos-publish-local
ifeq ($(PROFILER),true)
# profiler enabled
cd ${ONOS_ROOT} && \
. tools/build/envDefaults && \
- docker build . -t ${ONOS_IMAGENAME} \
+ docker build . -t ${ONOS_BASE_IMAGENAME} \
--build-arg PROFILE=${ONOS_PROFILE} \
--build-arg ONOS_YOURKIT=${ONOS_YOURKIT} \
-f tools/dev/Dockerfile-yourkit
@@ -257,12 +258,12 @@
cd ${ONOS_ROOT} && \
. tools/build/envDefaults && \
bazel build onos --define profile=${ONOS_PROFILE}
- docker build -t ${ONOS_IMAGENAME} -f ${ONOS_ROOT}/tools/dev/Dockerfile-bazel ${ONOS_ROOT}/bazel-bin
+ docker build -t ${ONOS_BASE_IMAGENAME} -f ${ONOS_ROOT}/tools/dev/Dockerfile-bazel ${ONOS_ROOT}/bazel-bin
else
# profiler not enabled
cd ${ONOS_ROOT} && \
. tools/build/envDefaults && \
- docker build . -t ${ONOS_IMAGENAME} \
+ docker build . -t ${ONOS_BASE_IMAGENAME} \
--build-arg PROFILE=${ONOS_PROFILE}
endif
make .onos-publish-local
@@ -270,15 +271,15 @@
.onos-publish-local:
ifeq ($(USE_LOCAL_SNAPSHOT_ARTIFACTS),true)
@# TODO: build custom docker container with required dependencies instead of installing via publish-local script
- docker run --rm --entrypoint bash -it -v $(shell pwd)/:/tost \
- -e ONOS_ROOT=/tost/onos -e MAVEN_REPO=/tost/.m2/repository -w /tost \
+ docker run --rm --entrypoint bash -it -v $(shell pwd)/:/src \
+ -e ONOS_ROOT=/src/onos -e MAVEN_REPO=/src/.m2/repository -w /src \
bitnami/minideb:buster ./publish-local.sh
endif
touch .onos-publish-local
-tost-build: ## : Builds the tost docker image
+package: ## : Builds the sdfabric-onos docker image
docker build $(DOCKER_BUILD_ARGS) \
- -t ${TOST_IMAGENAME} \
+ -t ${FINAL_IMAGENAME} \
--build-arg DOCKER_TAG="${DOCKER_TAG}${DOCKER_TAG_PROFILER}${DOCKER_TAG_BUILD_DATE}" \
--build-arg LOCAL_APPS=${LOCAL_APPS} \
--build-arg KARAF_VERSION=${KARAF_VERSION} \
@@ -291,19 +292,19 @@
--build-arg org_onosproject_trellis_t3_version="$(shell cd ${TRELLIS_T3_ROOT} && git rev-parse HEAD)"\
--build-arg org_omecproject_up4_version="$(shell cd ${UP4_ROOT} && git rev-parse HEAD)"\
--build-arg org_stratumproject_fabric_tna_version="$(shell cd ${FABRIC_TNA_ROOT} && git rev-parse HEAD)"\
- -f Dockerfile.tost .
+ -f Dockerfile .
-onos-push: ## : Pushes the tost-onos docker image to an external repository
- docker push ${ONOS_IMAGENAME}
+onos-push: ## : Pushes the onos-base docker image to an external repository
+ docker push ${ONOS_BASE_IMAGENAME}
-tost-push: ## : Pushes the tost docker image to an external repository
- docker push ${TOST_IMAGENAME}
+push: ## : Pushes the sdfabric-onos docker image to an external repository
+ docker push ${FINAL_IMAGENAME}
# Used for CI job
-docker-build: check-scripts onos-build apps-build tost-build ## : Builds the tost image
+docker-build: check-scripts onos-build apps-build package ## : Builds the sdfabric-onos image
# User for CD job
-docker-push: tost-push ## : Pushes the tost image
+docker-push: push ## : Pushes the sdfabric-onos Docker image
clean: ## : Deletes any locally copied files or artifacts
rm -rf ${ONOS_ROOT}
diff --git a/README.md b/README.md
index 1d5162f..25e08f2 100644
--- a/README.md
+++ b/README.md
@@ -1,30 +1,26 @@
-# TOST ONOS Development Build Environment
+# SD-Fabric ONOS Development Build Environment
-Docker build environment capable of producing a version of **ONOS** and needed apps that make the SD-Fabric control plane.
-
-The name TOST comes from the early days of the SD-Fabric project. It stands for Trellis ONOS Stratum Tofino. We keep this name for backward compatibility.
-
-Typically the **ONOS** restful api would be used to include apps after **ONOS** is started.
+This repository contains scripts required to build `sdfabric-onos`, a Docker image containing **ONOS** and other apps that make the SD-Fabric control plane.
## Build
-We provide multiple build targets for the Makefile. Versions of the components are defined in `Makefile.vars.*` files; `stable` version points to well known stable commits and `master` branch points to **ONOS** master and to the tip of the **TOST** components. **DOCKER_TAG** is used to select which version to build, by default points to `stable`.
+We provide multiple build targets for the Makefile. Versions of the components are defined in `Makefile.vars.*` files; `stable` version points to well known stable commits and `master` branch points to **ONOS** master and to the tip of external apps. **DOCKER_TAG** is used to select which version to build, by default points to `stable`.
-`onos-build` is used to build a specialized **Docker** image of **ONOS** (`tost-onos`) that will contain only the apps needed by **TOST**. It depends on `onos` target, which is used to setup the `onos` workspace for the build. It clones `onos` if it does not exist in the workspace, it will try to checkout the **ONOS_VERSION** first and in case of failure will try to download the patchset from remote repository. **ONOS_VERSION** is defined in `Makefile.vars.DOCKER_TAG` file, overriding the variable at run time it is possible to build a different version of **ONOS**.
+`onos-build` is used to build a specialized **Docker** image of **ONOS** that will contain only a subset of the ONOS built-in apps. It depends on `onos` target, which is used to setup the `onos` workspace for the build. It clones `onos` if it does not exist in the workspace, it will try to checkout the **ONOS_VERSION** first and in case of failure will try to download the patchset from remote repository. **ONOS_VERSION** is defined in `Makefile.vars.DOCKER_TAG` file, overriding the variable at run time it is possible to build a different version of **ONOS**.
```sh
-# Build a tost-onos image from the current workspace.
+# Build an onos image from the current workspace.
make onos-build
```
```sh
-# Build a tost-onos image from the tip of the onos-2.2 branch.
+# Build an onos image from the tip of the onos-2.2 branch.
make ONOS_VERSION=onos-2.2 onos-build
```
```sh
-# Build a tost-onos image from the review 12345.
+# Build an onos image from the change number/review 12345.
make ONOS_VERSION=ref/changes/72/12345/1 onos-build
```
@@ -50,18 +46,18 @@
make apps-build
```
-Finally, the last build target is `tost-build`. It builds a `tost` monolithic image using as base the `tost-onos` image. It basically adds the external apps used by **TOST**. It does not activate all the required apps. This step is performed during the deployment and the required apps are specified in the chart.
+Finally, the last build target is `build`. It builds a `sdfabric-onos` monolithic including the `onos-base` image plus the external apps. It does not activate all the required apps. This step is performed during the deployment. The required apps are usually specified in the Helm chart.
```sh
-# Build a tost image from the current workspace.
-make tost-build
+# Build a sdfabric-onos image from the current workspace.
+make package
```
### Build with custom ONOS API changes
When doing ONOS API changes, we don't want to fetch ONOS maven artifacts from the
remote sonatype SNAPSHOT repository. To do so, we need to set an environment variable
(`USE_LOCAL_SNAPSHOT_ARTIFACTS=true`) and follow a specific order when building the
-`tost` image.
+final `sdfabric-onos` image.
1. ONOS (this will also publish the ONOS maven artifacts in the local `.m2` folder):
`USE_LOCAL_SNAPSHOT_ARTIFACTS=true [DOCKER_TAG=master] make onos-build`
@@ -69,8 +65,8 @@
`USE_LOCAL_SNAPSHOT_ARTIFACTS=true [DOCKER_TAG=master] make trellis-control-build up4-build`
3. Trellis T3, Fabric TNA:
`USE_LOCAL_SNAPSHOT_ARTIFACTS=true [DOCKER_TAG=master] make fabric-tna-build trellis-t3-build`
-4. TOST:
- `USE_LOCAL_SNAPSHOT_ARTIFACTS=true [DOCKER_TAG=master] make tost-build`
+4. Final image (`sdfabric-onos`):
+ `USE_LOCAL_SNAPSHOT_ARTIFACTS=true [DOCKER_TAG=master] make package`
### Build with custom changes in the repositories
It is not always possible to build images with the latests changes, as sometimes hotfixes need to be delivered quickly in order to fix the issues identified in production. Hereafter the steps to build images with custom changes not yet merged - please note that we don't have the full flexibility provided by a separated “production” branch which means that sometimes the following workflow could not be realizable.
@@ -135,18 +131,18 @@
We provide multiple push target for the Makefile. Typically, you need to first login by `docker login` command to push the image on a repository.
-`onos-push` will push the `tost-onos` image.
+`onos-push` will push the `onos-base` image.
```sh
make onos-push
```
-`tost-push` will push the `tost` image on the defined **DOCKER_REGISTRY** and **DOCKER_REPOSITORY**.
+`push` will push the `sdfabric-onos` image to the defined **DOCKER_REGISTRY** and **DOCKER_REPOSITORY**.
```sh
-make DOCKER_REPOSITORY=onosproject/ tost-push
+make DOCKER_REPOSITORY=opennetworking/ push
```
## CI/CD targets
-There are two special targets used by the CI/CD jobs: `docker-build` and `docker-push`. The first target automates the build process of the `tost` image (`check-scripts`, `onos-build`, `apps-build` and `tost-build`). While the second one, it is just a `tost-push` called in a different way (temporary). Feel free to use them if you are ok with the prerequisites steps.
+There are two special targets used by the CI/CD jobs: `docker-build` and `docker-push`. The first target automates the build process of the `sdfabric-onos` image (`check-scripts`, `onos-build`, `apps-build` and `package`). While the second one is just an alias for `push`. Feel free to use them if you are ok with the prerequisites steps.
diff --git a/app-build.sh b/app-build.sh
index 1e9408c..4fd9d48 100755
--- a/app-build.sh
+++ b/app-build.sh
@@ -143,7 +143,7 @@
-Dmdep.useBaseVersion=true -Dmdep.overWriteReleases=true -Dmdep.overWriteSnapshots=true -f dependencies.xml \
-s mvn_settings.xml"
fi
- # Final step requires to move the oar to the folder used by the tost docker file. Moreover, it will help catch up errors
+ # Final step requires to move the oar to the folder used by Dockerfile. Moreover, it will help catch up errors
cp "${TRELLIS_CONTROL_OAR}" "${LOCAL_APPS}"/
}
diff --git a/dependencies.xml b/dependencies.xml
index e517437..82f6068 100644
--- a/dependencies.xml
+++ b/dependencies.xml
@@ -43,7 +43,7 @@
<!-- do not use "snapshots" repository name, otherwise when using
local maven cache it won't work since a fake mirror for snapshot
is added to the mvn_settings.xml -->
- <id>snapshots-tost</id>
+ <id>snapshots-sdfabric</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>