From fd4e8049c6082806cd193766c719a9d6f5caab3b Mon Sep 17 00:00:00 2001 From: Hunor Csomortáni Date: May 14 2018 11:10:02 +0000 Subject: [PATCH 1/3] Build image used in OpenShift from Fedora The .spec file change to update dependencies in order to use python2-* instead of python-* broken building on top of centos. Signed-off-by: Hunor Csomortáni --- diff --git a/openshift/Dockerfile b/openshift/Dockerfile index 226d192..1d1e281 100644 --- a/openshift/Dockerfile +++ b/openshift/Dockerfile @@ -2,7 +2,7 @@ # Build should be triggered from repo root like: # docker build -f openshift/Dockerfile --tag 172.30.1.1:5000/myproject/resultsdb:latest --build-arg resultsdb_rpm=resultsdb-2.0.2-1.fc25.noarch.rpm . -FROM centos/httpd:latest +FROM registry.fedoraproject.org/f27/httpd:latest LABEL \ name="ResultsDB application" \ vendor="ResultsDB developers" \ @@ -11,8 +11,6 @@ LABEL \ USER 0 -RUN yum -y install epel-release && yum -y clean all - # The caller should build a resultsdb RPM package using and then pass it in this arg. ARG resultsdb_rpm COPY $resultsdb_rpm /tmp From 8cf42ed7bf6d8a3c11808e086a03cb0e5e1566c4 Mon Sep 17 00:00:00 2001 From: Hunor Csomortáni Date: May 14 2018 11:13:58 +0000 Subject: [PATCH 2/3] Use 'app' label in the OpenShift test template When deployed together with other services (WaiverDB, Greenwave), this label can be used for selecting ResultsDB related resources. Signed-off-by: Hunor Csomortáni --- diff --git a/openshift/resultsdb-test-template.yaml b/openshift/resultsdb-test-template.yaml index 1685976..94a54bb 100644 --- a/openshift/resultsdb-test-template.yaml +++ b/openshift/resultsdb-test-template.yaml @@ -38,6 +38,7 @@ objects: name: "resultsdb-test-${TEST_ID}-secret" labels: environment: "test-${TEST_ID}" + app: resultsdb stringData: database-password: "${DATABASE_PASSWORD}" - apiVersion: v1 @@ -46,6 +47,7 @@ objects: name: "resultsdb-test-${TEST_ID}-config" labels: environment: "test-${TEST_ID}" + app: resultsdb stringData: settings.py: |- SECRET_KEY = '${RESULTSDB_SECRET_KEY}' @@ -65,6 +67,7 @@ objects: name: "resultsdb-test-${TEST_ID}-public-httpd-config" labels: environment: "test-${TEST_ID}" + app: resultsdb data: resultsdb.conf: |- @@ -79,6 +82,7 @@ objects: name: "resultsdb-test-${TEST_ID}-internal-httpd-config" labels: environment: "test-${TEST_ID}" + app: resultsdb data: resultsdb.conf: |- @@ -90,8 +94,10 @@ objects: name: "resultsdb-test-${TEST_ID}-database" labels: environment: "test-${TEST_ID}" + app: resultsdb spec: selector: + app: resultsdb environment: "test-${TEST_ID}" service: database ports: @@ -105,11 +111,13 @@ objects: labels: environment: "test-${TEST_ID}" service: database + app: resultsdb spec: replicas: 1 strategy: type: Recreate selector: + app: resultsdb environment: "test-${TEST_ID}" service: database template: @@ -117,6 +125,7 @@ objects: labels: environment: "test-${TEST_ID}" service: database + app: resultsdb spec: containers: - name: postgresql @@ -152,11 +161,13 @@ objects: name: "resultsdb-test-${TEST_ID}-api" labels: environment: "test-${TEST_ID}" + app: resultsdb annotations: service.alpha.openshift.io/dependencies: |- [{"name": "resultsdb-test-${TEST_ID}-database", "kind": "Service"}] spec: selector: + app: resultsdb environment: "test-${TEST_ID}" service: api ports: @@ -169,6 +180,7 @@ objects: name: "resultsdb-test-${TEST_ID}-api" labels: environment: "test-${TEST_ID}" + app: resultsdb spec: port: targetPort: api @@ -184,11 +196,13 @@ objects: name: "resultsdb-test-${TEST_ID}-internal-api" labels: environment: "test-${TEST_ID}" + app: resultsdb annotations: service.alpha.openshift.io/dependencies: |- [{"name": "resultsdb-test-${TEST_ID}-database", "kind": "Service"}] spec: selector: + app: resultsdb environment: "test-${TEST_ID}" service: internal-api ports: @@ -202,9 +216,11 @@ objects: labels: environment: "test-${TEST_ID}" service: api + app: resultsdb spec: replicas: 1 selector: + app: resultsdb environment: "test-${TEST_ID}" service: api template: @@ -212,6 +228,7 @@ objects: labels: environment: "test-${TEST_ID}" service: api + app: resultsdb spec: containers: - name: api @@ -260,9 +277,11 @@ objects: labels: environment: "test-${TEST_ID}" service: internal-api + app: resultsdb spec: replicas: 1 selector: + app: resultsdb environment: "test-${TEST_ID}" service: internal-api template: @@ -270,6 +289,7 @@ objects: labels: environment: "test-${TEST_ID}" service: internal-api + app: resultsdb spec: containers: - name: api From 8fcf251c8427aee96e7c833ffe3f576010eb8562 Mon Sep 17 00:00:00 2001 From: Hunor Csomortáni Date: May 14 2018 11:14:33 +0000 Subject: [PATCH 3/3] Allow anyone to POST a result For testing purposes it's easier to allow anyone to POST on the external facing service. Signed-off-by: Hunor Csomortáni --- diff --git a/openshift/resultsdb-test-template.yaml b/openshift/resultsdb-test-template.yaml index 94a54bb..250e856 100644 --- a/openshift/resultsdb-test-template.yaml +++ b/openshift/resultsdb-test-template.yaml @@ -71,10 +71,10 @@ objects: data: resultsdb.conf: |- - - # allow only GET - Require method GET - + # + # # allow only GET + # Require method GET + # - apiVersion: v1 kind: ConfigMap