Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build legacy swarm with any netplugin branch #281

Merged
merged 2 commits into from
Nov 3, 2017
Merged

Conversation

chrisplo
Copy link
Contributor

During make build, user can specify:

  • NETPLUGIN_BRANCH - the branch to compile instead of latest release
  • NETPLUGIN_OWNER (if not contiv) - the username for the netplugin fork

When the branch is specified, only the full installer is built.

A lot of the environment / config for the build has moved to the
Makefile and enviornment variables so it's easy to find and set, and
they are largely prefixed with CONTIV_

Some decomposition of the build has happened (ansible and netplugin
split out into separate scripts and targets), getting us part way to
build.sh being only an assembling of assets gathered by other scripts
and dropped in artifact_staging directory.

Preparing the release tarball is done in a random temp directory that
is cleaned up automatically.

build.sh no longer takes a bunch of CLI arguments, instead relies on
enviornment variables, as this script is intended to be run by the
Makefile.

The legacy swarm mode prefers the full installer vs. the over the
internet installer.

Created a reusable installer unpacker that later can be used by other
install scripts.

Drive-by:

  • update the netplugin versions to 1.1.5

Makefile Outdated
export CONTIV_NETPLUGIN_VERSION := $(NETPLUGIN_OWNER)-$(NETPLUGIN_BRANCH)
endif
export CONTIV_NETPLUGIN_TARBALL_NAME := netplugin-$(CONTIV_NETPLUGIN_VERSION).tar.bz2
export CONTIV_ANSIBLE_COMMIT ?= 4e67f54a8042debfc3d8b504046d0a1d4ea38c37
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hard coded sha1?

Copy link
Contributor Author

@chrisplo chrisplo Oct 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that actually is already merged to master, i will try rebasing that feature was merged to master, this is just relocating it to Makefile:
#265

During make build, user can specify:
* NETPLUGIN_BRANCH - the branch to compile instead of latest release
* NETPLUGIN_OWNER (if not contiv) - the username for the netplugin fork

When the branch is specified, only the full installer is built.

A lot of the environment / config for the build has moved to the
Makefile and enviornment variables so it's easy to find and set, and
they are largely prefixed with CONTIV_

Some decomposition of the build has happened (ansible and netplugin
split out into separate scripts and targets), getting us part way to
build.sh being only an assembling of assets gathered by other scripts
and dropped in artifact_staging directory.

Preparing the release tarball is done in a random temp directory that
is cleaned up automatically.

build.sh no longer takes a bunch of CLI arguments, instead relies on
enviornment variables, as this script is intended to be run by the
Makefile.

The legacy swarm mode prefers the full installer vs. the over the
internet installer.

Created a reusable installer unpacker that later can be used by other
install scripts.

Drive-by:
- update the netplugin versions to 1.1.5
@chrisplo
Copy link
Contributor Author

chrisplo commented Nov 2, 2017

rebased due to merge conflict

release_tarball="${release_name}.tgz"
release_local_tarball="contiv-full-${BUILD_VERSION}.tgz"
if [ -f "${release_local_tarball}" ]; then
tar oxf "${release_local_tarball}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we using full build for dev setups and minimal build for released versions?

Copy link
Contributor Author

@chrisplo chrisplo Nov 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for installing here, it's looking for full build first (which both dev and release builds create) but the fall back is that if the build wasn't made local, thent he BUILD_VERSION was an actual release version that is available to download. As a side note, the dev build does not make the "small" installer because those dev versions are not downloadable

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't we always go to the else case for a release build? Unless if the release build was built locally?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Locally, the full installer is always built by build.sh, but the small installer is built only when NETPLUGIN_BRANCH is not defined:
https://github.com/contiv/install/pull/281/files#diff-d99b26f864526f6f8f79861d49deb922R72

Anyone downloading an running this target, that doesn't match up BUILD_VERSION to a BUILD_VERSION that was built locally, will not have a full installer, and so we'll hit the else case and it's expected in that scenario that only release builds apply. The second -f check allows for reinstall without re-downloading the small release installer.

scripts/build.sh Outdated

# the installer currently pulls the v2plugin image directly from Docker Hub, but
# this will change to being downloaded from the Docker Store in the future.
# because of this, the default value for this variable will become the latest
# version that is available in the Docker Store and should be considered
# independent of $contiv_version above.
v2plugin_version=${CONTIV_V2PLUGIN_VERSION:-"1.0.3"}
v2plugin_version=${CONTIV_V2PLUGIN_VERSION:-"1.1.5"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be $DEFAULT_DOWNLOAD_CONTIV_VERSION as well by default?

Despite what the comment says, we have never had this be the latest approved version on the Docker Store... should probably delete the comment, too. lol

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no prob, testing now

@dseevr dseevr merged commit 2eb4504 into contiv:master Nov 3, 2017
@chrisplo chrisplo deleted the cntv_26 branch November 3, 2017 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants