Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme.md build-on-dev #2435

Merged
merged 22 commits into from
Jul 24, 2023
Merged
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
3 changes: 2 additions & 1 deletion .github/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ After the release is deployed on Prod
## Update frontend/package.json
* version

TBV


1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,4 @@ This is a list that was created on 2023-02-01 with all Zelda Devs to provide alt
- New learning and applying it to our work

- Innovation work

14 changes: 14 additions & 0 deletions openshift-v4/templates/celery/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM artifacts.developer.gov.bc.ca/docker-remote/python:3.9.15
RUN apt-get update \
&& apt-get install -y git \
&& apt-get install -y supervisor
WORKDIR /app/tfrs
COPY . .
COPY ./security-scan/scan-handler/celery.conf /etc/supervisor/conf.d
RUN pip install --upgrade pip \
&& pip install -r backend/requirements.txt \
&& chgrp -R root /var/log/supervisor \
&& chmod -R g+w /var/log/supervisor \
&& chmod -R g+w /run || : \
&& chmod -R g+w /app
CMD ["supervisord"]
89 changes: 89 additions & 0 deletions openshift-v4/templates/celery/celery-bc-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
kind: Template
apiVersion: template.openshift.io/v1
metadata:
name: celery-bc
creationTimestamp:
parameters:
- name: NAME
displayName:
description: the module name entered when run yo bcdk:pipeline, which is tfrs
required: true
- name: SUFFIX
displayName:
description: sample is -pr-0
required: true
- name: VERSION
displayName:
description: image tag name for output
required: true
- name: GIT_URL
displayName:
description: tfrs repo
required: true
- name: GIT_REF
displayName:
description: tfrs repo ref
required: true
objects:
- apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
annotations:
description: Keeps track of changes in the celery image
labels:
shared: "true"
creationTimestamp: null
name: ${NAME}-celery
spec:
lookupPolicy:
local: false
status:
dockerImageRepository: ""
- kind: BuildConfig
apiVersion: build.openshift.io/v1
metadata:
name: ${NAME}-celery${SUFFIX}
creationTimestamp:
spec:
triggers: []
runPolicy: Serial
source:
git:
uri: ${GIT_URL}
ref: ${GIT_REF}
type: Git
strategy:
type: Docker
dockerStrategy:
dockerfilePath: openshift-v4/templates/celery/Dockerfile
noCache: true
env:
- name: ARTIFACTORY_USER
valueFrom:
secretKeyRef:
name: artifacts-default-cgcynz
key: username
- name: ARTIFACTORY_PASSWORD
valueFrom:
secretKeyRef:
name: artifacts-default-cgcynz
key: password
forcePull: true
output:
to:
kind: ImageStreamTag
name: ${NAME}-celery:${VERSION}
resources:
limits:
cpu: 1500m
memory: 1300Mi
requests:
cpu: 750m
memory: 650Mi
postCommit: {}
nodeSelector:
successfulBuildsHistoryLimit: 5
failedBuildsHistoryLimit: 5
status:
lastVersion: 0
21 changes: 21 additions & 0 deletions openshift-v4/templates/celery/celery.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[supervisord]
nodaemon=true

[group:server]
programs=celerybeat,celeryworker

[program:celerybeat]
command=celery -A tfrs beat --loglevel=INFO
startsecs=5
redirect_stderr=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
directory=/app/tfrs/backend

[program:celeryworker]
command=celery -A tfrs worker --loglevel=INFO -E
startsecs=5
redirect_stderr=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
directory=/app/tfrs/backend
14 changes: 14 additions & 0 deletions openshift-v4/templates/scan-handler/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM artifacts.developer.gov.bc.ca/docker-remote/python:3.9.15
RUN apt-get update \
&& apt-get install -y git \
&& apt-get install -y supervisor
WORKDIR /app/tfrs
COPY . .
COPY security-scan/scan-handler/scan-handler.conf /etc/supervisor/conf.d
RUN pip install --upgrade pip \
&& pip install -r backend/requirements.txt \
&& chgrp -R root /var/log/supervisor \
&& chmod -R g+w /var/log/supervisor \
&& chmod -R g+w /run || : \
&& chmod -R g+w /app
CMD ["supervisord"]
89 changes: 89 additions & 0 deletions openshift-v4/templates/scan-handler/scan-handler-bc-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
kind: Template
apiVersion: template.openshift.io/v1
metadata:
name: scan-handler-bc
creationTimestamp:
parameters:
- name: NAME
displayName:
description: the module name entered when run yo bcdk:pipeline, which is tfrs
required: true
- name: SUFFIX
displayName:
description: sample is -pr-0
required: true
- name: VERSION
displayName:
description: image tag name for output
required: true
- name: GIT_URL
displayName:
description: tfrs repo
required: true
- name: GIT_REF
displayName:
description: tfrs repo ref
required: true
objects:
- apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
annotations:
description: Keeps track of changes in the celery image
labels:
shared: "true"
creationTimestamp: null
name: ${NAME}-scan-handler
spec:
lookupPolicy:
local: false
status:
dockerImageRepository: ""
- kind: BuildConfig
apiVersion: build.openshift.io/v1
metadata:
name: ${NAME}-scan-handler${SUFFIX}
creationTimestamp:
spec:
triggers: []
runPolicy: Serial
source:
type: Git
git:
uri: ${GIT_URL}
ref: ${GIT_REF}
strategy:
type: Docker
dockerStrategy:
dockerfilePath: openshift-v4/templates/scan-handler/Dockerfile
noCache: true
env:
- name: ARTIFACTORY_USER
valueFrom:
secretKeyRef:
name: artifacts-default-cgcynz
key: username
- name: ARTIFACTORY_PASSWORD
valueFrom:
secretKeyRef:
name: artifacts-default-cgcynz
key: password
forcePull: true
output:
to:
kind: ImageStreamTag
name: ${NAME}-scan-handler:${VERSION}
resources:
limits:
cpu: 1500m
memory: 1300Mi
requests:
cpu: 750m
memory: 650Mi
postCommit: {}
nodeSelector:
successfulBuildsHistoryLimit: 5
failedBuildsHistoryLimit: 5
status:
lastVersion: 0