Skip to content

Commit 696f049

Browse files
Merge pull request #7 from smarterclayton/generic
React to changes in base origin-gce; make run generic
2 parents 2f1abd8 + 07387cb commit 696f049

File tree

9 files changed

+47
-200
lines changed

9 files changed

+47
-200
lines changed

cluster/bin/run.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
ctr=gce-cluster
6+
7+
docker rm $ctr &>/dev/null || true
8+
docker create $@ --name $ctr -it openshift/origin-gce:latest /bin/bash >/dev/null
9+
tar --mode='ug+rwX' -c -C data . | docker cp - $ctr:/usr/share/ansible/openshift-ansible-gce/playbooks/files
10+
docker start -ai $ctr

cluster/ci/README.md

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

3-
$ ./up.sh
3+
$ ../bin/run.sh
4+
$ export PR_REPO_URL=<a yum repo base URL containing OpenShift RPMs>
5+
$ ansible-playbook playbooks/provision.yaml
46

57
Will download the appropriate version of OpenShift and install it to
6-
GCE. You must populate the data directory with the appropriate secret
7-
data first (instructions pending).
8+
GCE. You must populate the `data` directory with the appropriate secret
9+
data first:
810

9-
To get a shell into the container with the right data, run:
11+
* ssl.crt / ssl.key: certificates for the master
12+
* gce.json: Service account credentials for installing the master
13+
* gce-registry.json: Service account credentials for the registry to use against GCS
14+
* identity-providers.json: GitHub OAuth info
15+
* ssh-privatekey / ssh-publickey: An SSH key pair for connecting to the masters (optional)
1016

11-
$ $(./run.sh)
17+
The image `openshift/origin-gce:latest` is used as the environment for Ansible, and contains
18+
a copy of the `openshift-ansible` code and `origin-gce`.

cluster/ci/config.sh

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

cluster/ci/data/vars.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ deployment_type: origin
44
openshift_pkg_version: "-0.0.1"
55
ansible_pkg_mgr: yum
66
docker_upgrade: false
7+
openshift_version: 1.4.0 # work around 1.5 not being a valid option yet
8+
openshift_image_tag: v1.5.0-alpha.1
9+
openshift_additional_repos: [{'id': 'origin-pr', 'baseurl': '{{ lookup("env", "PR_REPO_URL") | default("https://https://storage.googleapis.com/origin-ci-test/branch-logs/master/zz_test_gcloud/latest/artifacts/rpms") }}', 'enabled': 1, 'gpgcheck': 0}]
10+
openshift_enable_origin_repo: false
711

812
# URLs and certs
913

@@ -22,13 +26,13 @@ openshift_node_port_range: 30000-32000
2226

2327
# Authentication and authorization
2428

25-
openshift_master_identity_providers: "{{ (lookup('file', ansible_env.HOME + '/identity-providers.json' ) | default('{\"items\":[]}') | from_json).get('items') }}"
29+
openshift_master_identity_providers: "{{ (lookup('file', 'files/identity-providers.json' ) | default('{\"items\":[]}') | from_json).get('items') }}"
2630
provision_role_mappings: [{'user': 'smarterclayton', 'role': 'cluster-admin'}]
2731

2832
# Paths on the local system for the certificate files. If empty, self-signed
2933
# certificate will be generated
30-
provision_master_https_cert_file: "{{ playbook_dir }}/files/ssl.crt"
31-
provision_master_https_key_file: "{{ playbook_dir }}/files/ssl.key"
34+
provision_master_https_cert_file: "ssl.crt"
35+
provision_master_https_key_file: "ssl.key"
3236

3337
# Post config setting sizes
3438

@@ -43,9 +47,9 @@ gce_project_id: openshift-gce-devel
4347
gce_region_name: us-central1
4448
gce_zone_name: us-central1-a
4549
gce_service_account: [email protected]
46-
gce_service_account_keyfile: "{{ lookup('file', 'files/gce.json') }}"
50+
gce_service_account_keyfile: "gce.json"
4751
gce_ssh_private_key: /home/cloud-user/.ssh/google_compute_engine
48-
gcs_registry_keyfile: "{{ lookup('file', 'files/gce.json') }}"
52+
gcs_registry_keyfile: "gcs-registry.json"
4953
inventory_ip_type: external
5054

5155
gce_extra_tags_master: ",preserve"
@@ -87,6 +91,6 @@ provision_gce_registry_gcs_bucket: openshift-gce-devel-origin-ci-registry-bucket
8791
provision_gce_router_network_instance_group: ig-m # default: ig-i
8892

8993
# Provide a startup script file to the GCE instances
90-
provision_gce_startup_script_file: "{{ playbook_dir }}/files/startup.sh"
94+
provision_gce_startup_script_file: # "startup.sh"
9195
# Provide userdata to the gce instances
9296
provision_gce_user_data_file:

cluster/ci/run.sh

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

cluster/ci/up.sh

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

cluster/test-deploy/data/vars.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ openshift_node_port_range: 30000-32000
3939
# Authentication and authorization
4040

4141
openshift_master_identity_providers: [{'name': 'allow_all', 'login': 'true', 'challenge': 'true', 'kind': 'AllowAllPasswordIdentityProvider'}]
42-
provision_role_mappings: [{'user': 'admin', 'role': 'cluster-admin'}]
42+
# provision_role_mappings: [{'user': 'admin', 'role': 'cluster-admin'}]
4343

4444
# Paths on the local system for the certificate files. If empty, self-signed
4545
# certificate will be generated

cluster/test-deploy/run.sh

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

cluster/test-deploy/up.sh

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,25 @@ data=$2
77
url=${3-}
88

99
# provide simple defaulting of playbooks
10-
playbook="${4:-playbooks/provision.yaml}"
10+
playbook="${4:-playbooks/launch.yaml}"
1111
if [[ -z "${3-}" && -z "${4-}" ]]; then
12-
playbook="playbooks/deprovision.yaml"
12+
playbook="playbooks/terminate.yaml"
1313
fi
1414

15+
ctr=gce-pr-$build
16+
1517
# start a container with the custom playbook inside it
16-
docker rm gce-pr-$build &>/dev/null || true
18+
docker rm $ctr &>/dev/null || true
1719
args=""
1820
if [[ -n "${OPENSHIFT_ANSIBLE_REPO-}" ]]; then
19-
docker volume rm gce-pr-$build-volume &>/dev/null || true
20-
docker volume create --name gce-pr-$build-volume >/dev/null
21-
args="-v gce-pr-$build-volume:/usr/share/ansible/openshift-ansible "
21+
docker volume rm $ctr-volume &>/dev/null || true
22+
docker volume create --name $ctr-volume >/dev/null
23+
args="-v $ctr-volume:/usr/share/ansible/openshift-ansible "
2224
fi
23-
docker create -e "PR_NUMBER=pr${build}" -e "PR_REPO_URL=${url}" --name gce-pr-$build $args openshift/origin-gce:latest ansible-playbook "${@:5}" "${playbook}" >/dev/null
24-
tar -c -C "${data}" . | docker cp - gce-pr-$build:/usr/share/ansible/openshift-ansible-gce/playbooks/files
25+
docker create -e "PR_NUMBER=pr${build}" -e "PR_REPO_URL=${url}" --name $ctr $args openshift/origin-gce:latest ansible-playbook "${@:5}" "${playbook}" >/dev/null
26+
tar -c -C "${data}" . | docker cp - $ctr:/usr/share/ansible/openshift-ansible-gce/playbooks/files
2527
if [[ -n "${OPENSHIFT_ANSIBLE_REPO-}" ]]; then
26-
tar -c -C "${OPENSHIFT_ANSIBLE_REPO}" . | docker cp - gce-pr-$build:/usr/share/ansible/openshift-ansible/
28+
tar -c -C "${OPENSHIFT_ANSIBLE_REPO}" . | docker cp - $ctr:/usr/share/ansible/openshift-ansible/
2729
fi
28-
docker start -a gce-pr-$build
29-
docker cp gce-pr-$build:/tmp/admin.kubeconfig admin.kubeconfig &>/dev/null || true
30+
docker start -a $ctr
31+
docker cp $ctr:/tmp/admin.kubeconfig admin.kubeconfig &>/dev/null || true

0 commit comments

Comments
 (0)