Skip to content

Commit bb87967

Browse files
authored
Updates to build, deployment and development for OCP4 and Fider 0.21.1 (#42)
* OCP4 updates * Trying w updated Node version * Updating reference to Artifactory (sub-folder) * Resolving 'Error shutting down storage: A layer is mounted: layer is in use by a container' issue * Downgrading to go version pre-v18, to workaround go-gitea/gitea#19455 * Confirmed local workaround to Go V18+, now testing on OpenShift v4 * Moved SMTP override sed statement to after 'copy fider .' * Trying again to debug 'layer is in use by a container' * Debugging 2 * Debugging 3 * Debug mode enabled * Updated fo OCP4 and SSO Shared Realm
1 parent a7e7d24 commit bb87967

File tree

6 files changed

+48
-43
lines changed

6 files changed

+48
-43
lines changed

Dockerfile.dev

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,42 @@
11
#####################
22
### Server Build Step
33
#####################
4-
FROM golang:1.16.6-buster AS server-builder
4+
FROM --platform=${TARGETPLATFORM:-linux/amd64} golang:1.17-buster AS server-builder
55

6-
ARG buildnumber=local
76

87
RUN mkdir /server
98
WORKDIR /server
109

11-
COPY . .
12-
RUN BUILDNUMBER=${buildnumber} GOOS=linux GOARCH=amd64 make build-server
10+
COPY fider/go.mod fider/go.sum ./
11+
RUN go mod download
12+
13+
COPY fider .
14+
15+
ARG COMMITHASH
16+
RUN COMMITHASH=${COMMITHASH} GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build-server
1317

1418
#################
1519
### UI Build Step
1620
#################
17-
FROM node:16-buster AS ui-builder
21+
FROM --platform=${TARGETPLATFORM:-linux/amd64} node:16-buster AS ui-builder
1822

19-
RUN mkdir /ui
2023
WORKDIR /ui
2124

22-
COPY . .
25+
COPY fider/package.json fider/package-lock.json ./
2326
RUN npm ci
27+
28+
COPY fider .
2429
RUN make build-ssr
2530
RUN make build-ui
2631

2732
################
2833
### Runtime Step
2934
################
30-
FROM debian:buster-slim
35+
FROM --platform=${TARGETPLATFORM:-linux/amd64} debian:buster-slim
3136

3237
RUN apt-get update
33-
RUN apt-get install -y ca-certificates wget
34-
35-
# 'dockerize -wait'
36-
ENV DOCKERIZE_VERSION v0.6.1
37-
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
38-
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
39-
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
38+
RUN apt-get install -y ca-certificates
4039

41-
RUN mkdir /app
4240
WORKDIR /app
4341

4442
COPY --from=server-builder /server/migrations /app/migrations

Dockerfile.openshift

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,54 @@
1+
ARG DOCKER_REGISTRY=docker.io/library
2+
13
#####################
24
### Server Build Step
35
#####################
4-
FROM golang:1.16.6-buster AS server-builder
6+
FROM --platform=${TARGETPLATFORM:-linux/amd64} $DOCKER_REGISTRY/golang:1.17-buster AS server-builder
57

6-
ARG buildnumber=local
78

89
RUN mkdir /server
910
WORKDIR /server
1011

12+
COPY fider/go.mod fider/go.sum ./
13+
RUN go mod download
14+
1115
COPY fider .
1216

13-
# BC Gov: Override SMTP TLS
17+
ARG COMMITHASH
1418
RUN sed -i -e '/auth :=/d' \
1519
-e 's/servername, smtpConfig.EnableStartTLS, auth, email/servername, false, nil, email/g' \
1620
-e 's/Config{ServerName: host}/Config{InsecureSkipVerify: true, ServerName: host}/g' \
1721
app/services/email/smtp/smtp.go && \
18-
BUILDNUMBER=${buildnumber} GOOS=linux GOARCH=amd64 make build-server
22+
COMMITHASH=${COMMITHASH} GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build-server
1923

2024
#################
2125
### UI Build Step
2226
#################
23-
FROM node:16-buster AS ui-builder
27+
FROM --platform=${TARGETPLATFORM:-linux/amd64} $DOCKER_REGISTRY/node:16-buster AS ui-builder
2428

25-
RUN mkdir /ui
2629
WORKDIR /ui
2730

31+
COPY fider/package.json fider/package-lock.json ./
32+
RUN npm ci
33+
RUN npx browserslist@latest --update-db
34+
2835
COPY fider .
2936
# Override SMTP TLS
3037
RUN sed -i -e '/auth :=/d' \
3138
-e 's/servername, smtpConfig.EnableStartTLS, auth, email/servername, false, nil, email/g' \
3239
-e 's/Config{ServerName: host}/Config{InsecureSkipVerify: true, ServerName: host}/g' \
3340
app/services/email/smtp/smtp.go
34-
35-
RUN npm ci
3641
RUN make build-ssr
3742
RUN make build-ui
3843

3944
################
4045
### Runtime Step
4146
################
42-
FROM debian:buster-slim
47+
FROM --platform=${TARGETPLATFORM:-linux/amd64} $DOCKER_REGISTRY/debian:buster-slim
4348

4449
RUN apt-get update
4550
RUN apt-get install -y ca-certificates
4651

47-
RUN mkdir /app
4852
WORKDIR /app
4953

5054
COPY --from=server-builder /server/migrations /app/migrations

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ To create an image stream using this forked code (replace `<tools-namespace>` wi
8383
8484
Tag with the correct release version, matching the `major.minor` release tag at the source [repo](https://github.com/getfider/fider/releases). For example:
8585

86-
> oc -n &lt;tools-namespace&gt; tag fider-bcgov:latest fider-bcgov:0.18.0
86+
> oc -n &lt;tools-namespace&gt; tag fider-bcgov:latest fider-bcgov:0.21.1
8787
88-
NOTE: To update our Fider image, we would update the submodule (e.g. `0.19.0`) and then tag _this_ build as `latest`, and plan for a re-deploy using the newer image.
88+
NOTE: To update our Fider image, we would update the submodule (e.g. `0.21.1`) and then tag _this_ build as `latest`, and plan for a re-deploy using the newer image.
8989

9090
> git submodule update --init --recursive
9191
@@ -381,13 +381,13 @@ Authentication -> Add New
381381
OAuth2
382382
Client ID : dds-portfolio
383383
Client Secret : <xxxxx>-<xxxx>-<xxxx>-<xxxx>-<xxxxx>
384-
Authorize URL : https://dev.oidc.gov.bc.ca/auth/realms/onestopauth-basic/protocol/openid-connect/auth
385-
Token URL : https://dev.oidc.gov.bc.ca/auth/realms/onestopauth-basic/protocol/openid-connect/token
386-
Scope: openid, email, address, phone, roles
384+
Authorize URL : https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/auth
385+
Token URL : https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token
386+
Scope: openid
387387
Profile API URL: (empty)
388388
JSON PATH
389389
ID: sub
390-
Name: name
390+
Name: displayname
391391
Email: email
392392
```
393393

ci/openshift/fider-bcgov.bc.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
kind: Template
3-
apiVersion: v1
3+
apiVersion: template.openshift.io/v1
44
message: A new Fider Image, customized with noTLS, has been created in your project
55
metadata:
66
name: nrm-feedback-bc
@@ -42,18 +42,21 @@ objects:
4242
strategy:
4343
type: Docker
4444
dockerStrategy:
45-
from:
46-
kind: DockerImage
47-
name: debian:buster-slim
4845
dockerfilePath: Dockerfile.openshift
46+
buildArgs:
47+
- name: DOCKER_REGISTRY
48+
value: artifacts.developer.gov.bc.ca/docker-remote
49+
# value: docker.io/library
50+
pullSecret:
51+
name: docker-pull-passthru
4952
output:
5053
to:
5154
kind: ImageStreamTag
5255
name: "${NAME}:${VERSION}"
5356
resources:
5457
limits:
55-
cpu: 700m
56-
memory: 4096Mi
58+
cpu: 1500m
59+
memory: 1800Mi
5760
requests:
5861
cpu: 500m
59-
memory: 3020Mi
62+
memory: 500Mi

ci/openshift/fider-bcgov.dc.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
kind: Template
3-
apiVersion: v1
3+
apiVersion: template.openshift.io/v1
44
message: A new Fider application, customized with noTLS, has been created in your project
55
metadata:
66
name: nrmf-feedback-dc
@@ -16,7 +16,7 @@ parameters:
1616
- description: Version of Feedback image to be used (e.g. v0.18.0)
1717
displayName: Version of Fider Product Feedback
1818
name: IS_VERSION
19-
value: 0.19.1
19+
value: 0.21.1
2020
- description: The short-name of the Feedback Product, lower-case with hyphen.
2121
displayName: Feedback Product Name
2222
name: FEEDBACK_NAME

ci/openshift/postgresql.dc.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
kind: Template
3-
apiVersion: v1
3+
apiVersion: template.openshift.io/v1
44
message: A new PostgreSQL application has been created in your project
55
metadata:
66
name: nrmfeedback-postgresql-dc
@@ -25,7 +25,7 @@ parameters:
2525
displayName: Database Volume Capacity
2626
name: DB_VOLUME_CAPACITY
2727
required: true
28-
value: 4Gi
28+
value: 2Gi
2929
objects:
3030
- kind: Secret
3131
apiVersion: v1

0 commit comments

Comments
 (0)