Skip to content

Commit ecdb131

Browse files
Use correct version for builds now that Origin builds real RPMs
Drop old settings, standardize a lot of our scripts.
1 parent a9e5510 commit ecdb131

File tree

7 files changed

+98
-67
lines changed

7 files changed

+98
-67
lines changed

cluster/bin/local.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
ctr=gce-build-"$( date +%Y%m%d-%H%M%S )"
5+
6+
function cleanup() {
7+
docker kill $ctr &>/dev/null || true
8+
docker rm $ctr &>/dev/null || true
9+
}
10+
trap cleanup EXIT
11+
cleanup
12+
13+
# start a container with the custom playbook inside it
14+
opts="--mode=ug+rwX --owner=0 --group=0"
15+
args=""
16+
if [[ -n "${OPENSHIFT_ANSIBLE_REPO-}" ]]; then
17+
docker volume rm $ctr-volume &>/dev/null || true
18+
docker volume create --name $ctr-volume >/dev/null
19+
args="-v $ctr-volume:/usr/share/ansible/openshift-ansible "
20+
fi
21+
22+
if [[ $# -eq 0 ]]; then
23+
args+="-it "
24+
docker create --name "$ctr" -e "INSTANCE_PREFIX=${INSTANCE_PREFIX}" -e "OPENSHIFT_ANSIBLE_COMMIT=${OPENSHIFT_ANSIBLE_COMMIT-}" $args "${OPENSHIFT_ANSIBLE_IMAGE:-openshift/origin-gce:latest}" /bin/bash >/dev/null
25+
else
26+
docker create --name "$ctr" -e "INSTANCE_PREFIX=${INSTANCE_PREFIX}" -e "OPENSHIFT_ANSIBLE_COMMIT=${OPENSHIFT_ANSIBLE_COMMIT-}" $args "${OPENSHIFT_ANSIBLE_IMAGE:-openshift/origin-gce:latest}" "$@" >/dev/null
27+
fi
28+
29+
tar ${opts} -c . | docker cp - $ctr:/usr/share/ansible/openshift-ansible-gce/playbooks/files
30+
if [[ -n "${OPENSHIFT_ANSIBLE_REPO-}" ]]; then
31+
tar ${opts} -c -C "${OPENSHIFT_ANSIBLE_REPO}" . | docker cp - $ctr:/usr/share/ansible/openshift-ansible/
32+
fi
33+
34+
if [[ $# -eq 0 ]]; then
35+
docker start -ai "${ctr}"
36+
else
37+
docker start -a "${ctr}"
38+
fi
39+
docker cp "$ctr":/tmp/admin.kubeconfig admin.kubeconfig &>/dev/null || true

cluster/bin/run.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

cluster/ci/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Deploy the OpenShift CI instance to GCE
22

3-
$ ../bin/run.sh
3+
$ ../bin/local.sh
44
$ export PR_REPO_URL=<a yum repo base URL containing OpenShift RPMs>
55
$ ansible-playbook playbooks/provision.yaml
66

cluster/test-deploy/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Deploy OpenShift for e2e testing on GCE
2+
3+
Standard setup for an e2e test environment on GCE is provided in this directory. The data directory
4+
should have:
5+
6+
* `gce.json` containing the GCE service account credentials to use that have permission to create instances, networks, and a bucket in project `openshift-gce-devel-ci`
7+
* `ops-mirror.pem` containing the client certificate for the OpenShift ops mirror
8+
* `ssh-privatekey` (optional) with the private key to use for the GCE instances
9+
* `ssh-publickey` (optional) a key to use with the above private key
10+
11+
See `data/vars.yaml` for the default settings. This depends on the `openshift/origin-gce:latest` image
12+
which is a pre-built version of the GCE reference architecture and the openshift-ansible playbooks for the
13+
appropriate release.
14+
15+
```
16+
$ cd data
17+
18+
# launch cluster
19+
$ INSTANCE_PREFIX=pr345 ../../bin/local.sh ansible-playbook \
20+
-e openshift_test_repo=https://storage.googleapis.com/origin-ci-test/pr-logs/12940/test_pull_requests_origin_gce/559/artifacts/rpms \
21+
playbooks/launch.yaml
22+
23+
# after cluster is launched, admin.kubeconfig is copied locally
24+
$ KUBECONFIG=admin.kubeconfig oc status
25+
26+
# teardown cluster
27+
$ INSTANCE_PREFIX=pr345 ../../bin/local.sh ansible-playbook playbooks/terminate.yaml
28+
29+
# get a shell in the ansible environment
30+
$ INSTANCE_PREFIX=pr345 ../../bin/local.sh
31+
```
32+
33+
The following ansible variables are commonly used:
34+
35+
* `openshift_test_repo` is the URL to a yum repo to use to install
36+
* `openshift_image_tag` (optional) is the suffix of the image to run with
37+
* `openshift_pkg_version` (optional) is the exact package value to use `-0.0.1` if installing RPMs that don't match the desired version
38+
39+
The following environment variables can be provided
40+
41+
* `INSTANCE_PREFIX` is a value that should be unique across all clusters running in the project. It is provided as an env var to allow inventory to be calculated by Ansible.
42+
* `OPENSHIFT_ANSIBLE_IMAGE` (defaults to `openshift/origin-gce:latest`) the image to deploy from
43+

cluster/test-deploy/data/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
*
22
!.gitignore
3-
!ansible-config.yml
3+
!vars.yml

cluster/test-deploy/data/vars.yaml

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,28 @@
33
deployment_type: origin
44
ansible_pkg_mgr: yum
55

6-
# for initial install
7-
openshift_pkg_version: "-{{ ansible_env.PR_REPO_VERSION | default('0.0.1') }}" # try to remove
86
openshift_additional_repos: [
9-
{'id': 'origin-pr', 'baseurl': '{{ lookup("env", "PR_REPO_URL") }}', 'enabled': 1, 'gpgcheck': 0},
7+
{'id': 'origin-pr', 'baseurl': '{{ openshift_test_repo }}', 'enabled': 1, 'gpgcheck': 0},
108
{'id': 'origin-pr-dependencies', 'baseurl': 'http://buildlogs.centos.org/centos/7/paas/x86_64/openshift-future/', 'enabled': 1, 'gpgcheck': 0}
119
]
12-
openshift_version: 1.4.0 # work around 1.5 not being a valid option yet
13-
openshift_image_tag: v1.5.0-alpha.2 # necessary for upgrade?
14-
openshift_enable_origin_repo: false # must be true for upgrade
1510

1611
# for upgrading
17-
#openshift_pkg_version: "-1.3.1"
18-
#openshift_version: 1.4.0 # work around 1.5 not being a valid option
19-
#docker_upgrade: false
20-
#openshift_enable_origin_repo: true
12+
# openshift_pkg_version: "-1.3.1"
13+
# openshift_version: 1.4.0 # work around 1.5 not being a valid option
14+
# docker_upgrade: false
15+
# openshift_enable_origin_repo: true
2116

2217
# URLs and certs
2318

24-
provision_prefix: ci-{{ lookup('env', 'PR_NUMBER') | mandatory }}-
25-
gce_network_name: "ci-{{ lookup('env', 'PR_NUMBER') | mandatory }}-ocp-network"
19+
provision_prefix: ci-{{ lookup('env', 'INSTANCE_PREFIX') | mandatory }}-
20+
gce_network_name: "ci-{{ lookup('env', 'INSTANCE_PREFIX') | mandatory }}-ocp-network"
2621

27-
provision_gce_registry_gcs_bucket: origin-ci-test-{{ lookup('env', 'PR_NUMBER') | mandatory }}
28-
openshift_master_cluster_public_hostname: api.{{ lookup('env', 'PR_NUMBER') | mandatory }}.origin-ci-int-gce.dev.rhcloud.com
29-
openshift_master_cluster_hostname: internal-api.{{ lookup('env', 'PR_NUMBER') | mandatory }}.origin-ci-int-gce.dev.rhcloud.com
30-
wildcard_zone: apps.{{ lookup('env', 'PR_NUMBER') | mandatory }}.origin-ci-int-gce.dev.rhcloud.com
31-
openshift_master_public_api_url: "https://api.{{ lookup('env', 'PR_NUMBER') | mandatory }}.origin-ci-int-gce.dev.rhcloud.com/"
32-
openshift_master_public_console_url: "https://api.{{ lookup('env', 'PR_NUMBER') | mandatory }}.origin-ci-int-gce.dev.rhcloud.com/console"
22+
provision_gce_registry_gcs_bucket: origin-ci-test-{{ lookup('env', 'INSTANCE_PREFIX') | mandatory }}
23+
openshift_master_cluster_public_hostname: api.{{ lookup('env', 'INSTANCE_PREFIX') | mandatory }}.origin-ci-int-gce.dev.rhcloud.com
24+
openshift_master_cluster_hostname: internal-api.{{ lookup('env', 'INSTANCE_PREFIX') | mandatory }}.origin-ci-int-gce.dev.rhcloud.com
25+
wildcard_zone: apps.{{ lookup('env', 'INSTANCE_PREFIX') | mandatory }}.origin-ci-int-gce.dev.rhcloud.com
26+
openshift_master_public_api_url: "https://api.{{ lookup('env', 'INSTANCE_PREFIX') | mandatory }}.origin-ci-int-gce.dev.rhcloud.com/"
27+
openshift_master_public_console_url: "https://api.{{ lookup('env', 'INSTANCE_PREFIX') | mandatory }}.origin-ci-int-gce.dev.rhcloud.com/console"
3328

3429
public_hosted_zone: origin-ci-int-gce.dev.rhcloud.com
3530
dns_managed_zone: origin-ci-int-gce
@@ -84,7 +79,6 @@ provision_gce_instance_group_size_node: 3
8479
provision_gce_disk_size_node_docker: 75
8580
provision_gce_disk_size_node_openshift: 50
8681

87-
provision_rh_channel_version: "3.3"
8882
provision_gce_gcloud_version: '130.0.0'
8983

9084
# An image or image family to pull from
@@ -136,4 +130,4 @@ provision_custom_repositories: [
136130
"gpgcheck": 1,
137131
"gpgkey": "https://mirror.ops.rhcloud.com/libra/keys/RPM-GPG-KEY-redhat-release https://mirror.ops.rhcloud.com/libra/keys/RPM-GPG-KEY-redhat-beta https://mirror.ops.rhcloud.com/libra/keys/RPM-GPG-KEY-redhat-openshifthosted"
138132
}
139-
]
133+
]

cluster/test-deploy/up.sh

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)