Skip to content

Commit

Permalink
Merge pull request #197 from ropable/master
Browse files Browse the repository at this point in the history
Tweaks to Kustomize definitions
  • Loading branch information
ropable authored Nov 3, 2023
2 parents d8913a3 + d59363b commit 69ce445
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 14 deletions.
9 changes: 8 additions & 1 deletion kustomize/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,12 @@ spec:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: false
readOnlyRootFilesystem: true
volumeMounts:
- mountPath: /tmp
name: tmpfs-ram
volumes:
- name: tmpfs-ram
emptyDir:
medium: "Memory"
restartPolicy: Always
2 changes: 1 addition & 1 deletion kustomize/overlays/prod/cronjobs/harvest-dfes/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
spec:
containers:
- name: resourcetracking-cronjob
imagePullPolicy: Always
imagePullPolicy: IfNotPresent
args: ["manage.py", "harvest_dfes_feed"]
env:
- name: DATABASE_URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
spec:
containers:
- name: resourcetracking-cronjob
imagePullPolicy: Always
imagePullPolicy: IfNotPresent
args: ["manage.py", "harvest_tracking_email", "--device-type", "iriditrak", "--purge-email"]
env:
- name: DATABASE_URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
spec:
containers:
- name: resourcetracking-cronjob
imagePullPolicy: Always
imagePullPolicy: IfNotPresent
args: ["manage.py", "harvest_tracking_email", "--device-type", "mp70", "--purge-email"]
env:
- name: DATABASE_URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
spec:
containers:
- name: resourcetracking-cronjob
imagePullPolicy: Always
imagePullPolicy: IfNotPresent
args: ["manage.py", "harvest_tracking_email", "--device-type", "spot", "--purge-email"]
env:
- name: DATABASE_URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
spec:
containers:
- name: resourcetracking-cronjob
imagePullPolicy: Always
imagePullPolicy: IfNotPresent
args: ["manage.py", "harvest_tracplus"]
env:
- name: DATABASE_URL
Expand Down
1 change: 0 additions & 1 deletion kustomize/overlays/uat/cronjobs/harvest-dfes/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ spec:
spec:
containers:
- name: resourcetracking-cronjob
imagePullPolicy: Always
args: ["manage.py", "harvest_dfes_feed"]
env:
- name: DATABASE_URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ spec:
spec:
containers:
- name: resourcetracking-cronjob
imagePullPolicy: Always
args: ["manage.py", "harvest_tracking_email", "--device-type", "iriditrak"]
env:
- name: DATABASE_URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ spec:
spec:
containers:
- name: resourcetracking-cronjob
imagePullPolicy: Always
args: ["manage.py", "harvest_tracking_email", "--device-type", "mp70"]
env:
- name: DATABASE_URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ spec:
spec:
containers:
- name: resourcetracking-cronjob
imagePullPolicy: Always
args: ["manage.py", "harvest_tracplus"]
env:
- name: DATABASE_URL
Expand Down
5 changes: 4 additions & 1 deletion kustomize/template/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ spec:
containers:
- name: resourcetracking-cronjob
image: ghcr.io/dbca-wa/resource_tracking
imagePullPolicy: IfNotPresent
imagePullPolicy: Always
command: ["python"]
args: ["--version"]
env:
- name: TZ
value: "Australia/Perth"
securityContext:
runAsNonRoot: true
privileged: false
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ unicodecsv = "0.14.1"
whitenoise = {version = "6.5.0", extras = ["brotli"]}
azure-storage-blob = "12.17.0"
sentry-sdk = {version = "1.32.0", extras = ["django"]}
tomli = "2.0.1"

[tool.poetry.group.dev.dependencies]
ipython = "^8.13.0"
Expand Down
5 changes: 3 additions & 2 deletions resource_tracking/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,12 @@
SENTRY_ENVIRONMENT = env('SENTRY_ENVIRONMENT', None)
if SENTRY_DSN and SENTRY_ENVIRONMENT:
import sentry_sdk
from importlib import metadata
import tomli
project = tomli.load(open(os.path.join(BASE_DIR, "pyproject.toml"), "rb"))

sentry_sdk.init(
dsn=SENTRY_DSN,
traces_sample_rate=SENTRY_SAMPLE_RATE,
environment=SENTRY_ENVIRONMENT,
release=metadata.version("resource_tracking"),
release=project["tool"]["poetry"]["version"],
)

0 comments on commit 69ce445

Please sign in to comment.