Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ config.tfvars
id_rsa*
pull-secret.json
ssh-key.pem
tectonic-*.tar.gz
openshift-installer-*.tar.gz
tectonic-license.txt
terraform.tfstate*
terraform.tfvars
bin/
bin_test/
matchbox/
/contrib/govcloud/vpn.conf
tectonic-dev
openshift-installer-dev

# Bazel
.build/
Expand All @@ -22,5 +22,5 @@ bazel-bin
bazel-out
bazel-genfiles
bazel-testlogs
bazel-tectonic-installer
bazel-openshift-installer
.cache
12 changes: 6 additions & 6 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("//bazel-rules:gen_test.bzl", "gen_test")
load("//:version.bzl", "TECTONIC_VERSION")
load("//:version.bzl", "OPENSHIFT_VERSION")

package(
default_visibility = ["//visibility:public"],
Expand Down Expand Up @@ -49,7 +49,7 @@ alias(

alias(
name = "cli",
actual = "//installer/cmd/tectonic",
actual = "//installer/cmd/openshift-install",
)

template_files = glob([
Expand All @@ -69,18 +69,18 @@ load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")

alias(
name = "tarball",
actual = ":tectonic-%s" % TECTONIC_VERSION,
actual = ":openshift-installer-%s" % OPENSHIFT_VERSION,
)

pkg_tar(
name = "tectonic-%s" % TECTONIC_VERSION,
name = "openshift-installer-%s" % OPENSHIFT_VERSION,
mode = "0666",
srcs = [
"//:template_resources",
"//examples:tectonic_cli_examples",
],
extension = "tar.gz",
package_dir = "tectonic-%s" % TECTONIC_VERSION,
package_dir = "openshift-installer-%s" % OPENSHIFT_VERSION,
strip_prefix = ".",
deps = [
":cli_bin",
Expand All @@ -91,7 +91,7 @@ pkg_tar(
pkg_tar(
name = "cli_bin",
mode = "0777",
srcs = ["//installer/cmd/tectonic"],
srcs = ["//installer/cmd/openshift-install"],
package_dir = "installer",
)

Expand Down
32 changes: 16 additions & 16 deletions Documentation/dev/bazel-in-depth.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
# Bazel Under The Hood

The goal of this document is to detail the steps taken by Bazel when building the Tectonic Installer project so that users better understand the process. Ultimately, a user building the project could elect to build the project without Bazel, either by hand or otherwise. *Note*: building without Bazel is not recommended because it will lead to non-hermetic builds, which could lead to unpredictable results. We strongly recommend using the build instructions outlined in the README for consistent, reproducible builds.
The goal of this document is to detail the steps taken by Bazel when building the OpenShift Installer project so that users better understand the process. Ultimately, a user building the project could elect to build the project without Bazel, either by hand or otherwise. *Note*: building without Bazel is not recommended because it will lead to non-hermetic builds, which could lead to unpredictable results. We strongly recommend using the build instructions outlined in the README for consistent, reproducible builds.

This document covers the process of building the `tarball` Bazel target, which is the main target of the project.

## Build Layout
As noted in [build.md](build.md), the goal of the build process is to produce an archive with the following file structure:

```
tectonic
openshift-installer
├── config.tf
├── examples
├── modules
├── steps
└── tectonic-installer
└── installer
├── darwin
│ ├── tectonic
│ ├── openshift-install
│ └── terraform
└── linux
├── tectonic
├── openshift-install
Copy link
Member

Choose a reason for hiding this comment

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

This directory is stale, see #53.

└── terraform
```

## Steps
### Directories
Prepare the necessary output directories:

* `tectonic`
* `tectonic/examples`
* `tectonic/modules`
* `tectonic/steps`
* `tectonic/tectonic-installer`
* `tectonic/tectonic-installer/darwin`
* `tectonic/tectonic-installer/linux`
* `openshift-installer`
* `openshift-installer/examples`
* `openshift-installer/modules`
* `openshift-installer/steps`
* `openshift-installer/installer`
* `openshift-installer/installer/darwin`
* `openshift-installer/installer/linux`

### Go Build
Build the Tectonic CLI Golang binary located in `tectonic/installer/cmd/tectonic` using `go build …`
The binary should be built for both Darwin and Linux and placed in the corresponding output directory, i.e. `tectonic/tectonic-installer/darwin`, or `tectonic/tectonic-installer/linux`.
Build the OpenShift Installer CLI Golang binary located in `openshift-installer/installer/cmd/openshift-install` using `go build …`
The binary should be built for both Darwin and Linux and placed in the corresponding output directory, i.e. `openshift-installer/installer/darwin`, or `openshift-installer/installer/linux`.

### Terraform Binaries
Download binaries for Terraform for both Darwin and Linux and place them in the corresponding output directories.

### Terraform Configuration
Copy all required Terraform configuration files from their source directories and place them in the correct output directory. Specifically, `config.tf`, `modules` and `steps` should be copied to the output directory at `tectonic/config.tf`, `tectonic/modules`, and `tectonic/steps`, respectively.
Copy all required Terraform configuration files from their source directories and place them in the correct output directory. Specifically, `config.tf`, `modules` and `steps` should be copied to the output directory at `openshift-installer/config.tf`, `openshift-installer/modules`, and `openshift-installer/steps`, respectively.

### Configuration Examples
Copy the Tectonic Installer configuration examples from `examples` to the output directory at `tectonic/examples`.
Copy the OpenShift Installer configuration examples from `examples` to the output directory at `openshift-installer/examples`.

### Archive
Lastly, archive and gzip the output directory using the `tar` utility to produce the final asset.
54 changes: 23 additions & 31 deletions Documentation/dev/build.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# Building Tectonic Installer
# Building OpenShift Installer

The Tectonic Installer leverages the [Bazel build system](https://bazel.build/) to build all artifacts, binaries, and documentation.
The OpenShift Installer leverages the [Bazel build system](https://bazel.build/) to build all artifacts, binaries, and documentation.

## Getting Started

Install Bazel > 0.11.x using the instructions [provided online](https://docs.bazel.build/versions/master/install.html).
*Note*: compiling Bazel from source requires Bazel.
*Note*: some Linux platforms may require installing _Static libraries for the GNU standard C++ library_ (on Fedora `dnf install libstdc++-static`)

Clone the Tectonic Installer git repository locally:
Clone the OpenShift Installer git repository locally:

```sh
git clone [email protected]:coreos/tectonic-installer.git && cd tectonic-installer
git clone [email protected]:openshift/installer.git && cd installer
```

## Quickstart

To build Tectonic for development or testing, build the `tarball` target with Bazel:
To build OpenShift for development or testing, build the `tarball` target with Bazel:

```sh
bazel build tarball
```

This will produce an archive named `tectonic.tar.gz` in the `bazel-bin` directory, containing all the assets necessary to bring up a Tectonic cluster, namely the:
This will produce an archive named `openshift-installer-dev.tar.gz` in the `bazel-bin` directory, containing all the assets necessary to bring up a OpenShift cluster, namely the:

* Tectonic Installer binary;
* OpenShift Installer binary;
* Terraform modules;
* Terraform binary;
* Terraform provider binaries; and
Expand All @@ -34,17 +34,17 @@ To use the installer you can now do the following:

```sh
cd bazel-bin
tar -xvzf tectonic.tar.gz
cd tectonic
tar -xvzf openshift-installer-dev.tar.gz
cd openshift-installer-dev
```

Then proceed using the installer as documented on [coreos.com](https://coreos.com/tectonic/docs/).

For more details on building a Tectonic release or other Tectonic assets as well as workarounds to some known issues, read on.
For more details on building a OpenShift release or other OpenShift assets as well as workarounds to some known issues, read on.

## Building A Release Tarball

To build a release tarball for the Tectonic Installer, issue the following command from the `tectonic-installer` root directory:
To build a release tarball for the OpenShift Installer, issue the following command from the `installer` root directory:

```sh
bazel build tarball
Expand All @@ -56,41 +56,33 @@ bazel build tarball
bazel build --force_python=py2 --python_path=/usr/bin/python2 tarball
```

This will create a tarball named `tectonic.tar.gz` in the `bazel-bin` directory with the following directory structure:
This will create a tarball named `openshift-installer-dev.tar.gz` in the `bazel-bin` directory with the following directory structure:

```
tectonic
openshift-installer-dev
├── config.tf
├── examples
├── installer
├── modules
├── steps
└── tectonic-installer
├── darwin
│   ├── tectonic
│   ├── terraform
│   └── terraform-provider-matchbox
└── linux
├── tectonic
├── terraform
└── terraform-provider-matchbox
└── steps
```

In order to build a release tarball with the version string in the directory name within the tarball, export a `TECTONIC_VERSION` environment variable and then build the tarball while passing the variable to the build:
In order to build a release tarball with the version string in the directory name within the tarball, export a `OPENSHIFT_VERSION` environment variable and then build the tarball while passing the variable to the build:

```sh
export TECTONIC_VERSION=1.2.3-beta
bazel build tarball --action_env=TECTONIC_VERSION
export OPENSHIFT_VERSION=1.2.3-beta
bazel build tarball --action_env=OPENSHIFT_VERSION
```

This will create a tarball named `tectonic.tar.gz` in the `bazel-bin` directory with the following directory structure:
This will create a tarball named `openshift-install.tar.gz` in the `bazel-bin` directory with the following directory structure:

```
tectonic_1.2.3-beta
openshift-install_1.2.3-beta
├── config.tf
├── examples
├── installer
├── modules
├── steps
└── tectonic-installer
└── steps
```

*Note*: the generated tarball will not include the version string in its own name since output names must be known ahead of time in Bazel. To include the version in the tarball name, copy or move the archive with the desired name in the destination.
Expand All @@ -104,7 +96,7 @@ bazel build tests/smoke
```

This operation will produce a binary located at `bazel-bin/tests/smoke/linux_amd64_stripped/smoke`, if on a Linux machine, or `bazel-bin/tests/smoke/darwin_amd64_stripped/smoke`, if on a Mac.
Follow the [smoke test instructions][smoke-test] to test a Tectonic cluster using this newly compiled binary.
Follow the [smoke test instructions][smoke-test] to test a OpenShift cluster using this newly compiled binary.


## Cleaning
Expand Down
10 changes: 5 additions & 5 deletions Documentation/dev/libvirt-howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,26 +87,26 @@ bazel build tarball

### 3. Create a cluster
```sh
tar -zxf bazel-bin/tectonic-dev.tar.gz
cd tectonic-dev
tar -zxf bazel-bin/openshift-installer-dev.tar.gz
cd openshift-installer-dev
export PATH=$(pwd)/installer:$PATH
```

Initialize (the environment variables are a convenience):
```sh
tectonic init --config=../tectonic.libvirt.yaml
openshift-install init --config=../tectonic.libvirt.yaml
export CLUSTER_NAME=<the cluster name>
export BASE_DOMAIN=<the base domain>
```

Install ($CLUSTER_NAME is `test1`):
```sh
tectonic install --dir=$CLUSTER_NAME
openshift-install install --dir=$CLUSTER_NAME
```

When you're done, destroy:
```sh
tectonic destroy --dir=$CLUSTER_NAME
openshift-install destroy --dir=$CLUSTER_NAME
```
Be sure to destroy, or else you will need to manually use virsh to clean up the leaked resources.

Expand Down
4 changes: 2 additions & 2 deletions Documentation/dev/node-bootstrap-flow.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Node bootstrapping flow

This is a development document which describes the bootstrapping flow for ContainerLinux nodes provisioned by the tectonic-installer as part of a Tectonic cluster.
This is a development document which describes the bootstrapping flow for ContainerLinux nodes provisioned by the openshift-installer as part of a OpenShift cluster.

## Overview

Expand All @@ -24,7 +24,7 @@ Additionally, only on one of the master nodes the following kubernetes bootstrap

## Systemd units

The following systemd unit is deployed to a node by tectonic-installer and take part in the bootstrapping process:
The following systemd unit is deployed to a node by openshift-installer and take part in the bootstrapping process:

* `kubelet.service` is the main kubelet daemon. It is automatically started on boot.

Expand Down
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ pipeline {
sh """#!/bin/bash -e
export HOME=/home/jenkins
./tests/run.sh
cp bazel-bin/tectonic-dev.tar.gz .
cp bazel-bin/openshift-installer-dev.tar.gz .
"""
// Produce an artifact which can be downloaded via web UI
stash name: 'tectonic-tarball', includes: 'tectonic-dev.tar.gz'
stash name: 'openshift-installer-tarball', includes: 'openshift-installer-dev.tar.gz'
}
}
}
Expand All @@ -100,7 +100,7 @@ pipeline {
withCredentials(quayCreds) {
ansiColor('xterm') {
sh """
docker build -t quay.io/coreos/tectonic-installer:master -f images/tectonic-installer/Dockerfile .
docker build -t quay.io/coreos/tectonic-installer:master -f images/openshift-installer/Dockerfile .
docker login -u="$QUAY_ROBOT_USERNAME" -p="$QUAY_ROBOT_SECRET" quay.io
docker push quay.io/coreos/tectonic-installer:master
docker logout quay.io
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,37 @@ These instructions can be used for AWS:

3. Extract the tarball
```sh
tar -zxf bazel-bin/tectonic-dev.tar.gz
cd tectonic-dev
tar -zxf bazel-bin/openshift-installer-dev.tar.gz
cd openshift-installer-dev
```

4. Add binaries to $PATH
```sh
export PATH=$(pwd)/installer:$PATH
```

5. Edit Tectonic configuration file including the $CLUSTER_NAME
5. Edit OpenShift configuration file including the $CLUSTER_NAME
```sh
$EDITOR examples/tectonic.aws.yaml
$EDITOR examples/openshift.aws.yaml
```

6. Init Tectonic CLI
6. Init OpenShift Installer CLI
```sh
tectonic init --config=examples/tectonic.aws.yaml
openshift-install init --config=examples/openshift.aws.yaml
```

7. Install Tectonic cluster
7. Install OpenShift cluster
```sh
tectonic install --dir=$CLUSTER_NAME
openshift-install install --dir=$CLUSTER_NAME
```

8. Visit `https://{$CLUSTER_NAME}-api.${BASE_DOMAIN}:6443/console/`.
You may need to ignore a certificate warning if you did not configure a CA known to your browser.
Log in with the admin credentials you configured in `tectonic.aws.yaml`.
Log in with the admin credentials you configured in `openshift.aws.yaml`.

9. Teardown Tectonic cluster
9. Teardown OpenShift cluster
```sh
tectonic destroy --dir=$CLUSTER_NAME
openshift-install destroy --dir=$CLUSTER_NAME
```

## Managing Dependencies
Expand Down
2 changes: 1 addition & 1 deletion buildvars.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash -e

# Vars exported to the build info
echo TECTONIC_VERSION "${TECTONIC_VERSION}"
echo OPENSHIFT_VERSION "${OPENSHIFT_VERSION}"
echo BUILD_TIME "$(date -u '+%Y-%m-%dT%H:%M:%S%z')"
2 changes: 1 addition & 1 deletion examples/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
example_cli_configs = glob(["tectonic.*.yaml"])
example_cli_configs = glob(["openshift.*.yaml"])

filegroup(
name = "tectonic_cli_examples",
Expand Down
File renamed without changes.
File renamed without changes.
Loading