-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Dockerise PDT * Update workflow and makefile * Update Apt and workdir * Remove libssl-dev on image * Update dockerfile and add deployment config * Update dockerfile to accommodate all warnings * update cicd * Migrate to Kustomize * Remove ingress and svc * Remove PV, certificates and ingress * Remove pv references
- Loading branch information
Showing
13 changed files
with
140 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
target/ | ||
.vscode/ | ||
# Target for downloaded files | ||
downloads/ | ||
# Stores download metadata | ||
meta.json |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Requires alpine to get openssl and build | ||
FROM rust:1.71.0-bullseye as builder | ||
|
||
WORKDIR /pdt | ||
|
||
RUN apt-get update -y && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y --no-install-recommends protobuf-compiler=3.12.4-1+deb11u1 build-essential=12.9 cmake=3.18.4-2+deb11u1 | ||
|
||
RUN mkdir build | ||
|
||
COPY . . | ||
|
||
RUN --mount=type=cache,target=/usr/local/cargo/registry cargo build && \ | ||
mv /pdt/target/debug/pdt /pdt/build/ | ||
|
||
FROM debian:bullseye-slim | ||
|
||
RUN apt-get update -y && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y --no-install-recommends ca-certificates=20210119 && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=builder /pdt/build/pdt /pdt | ||
|
||
CMD ["/pdt", "test"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.PHONY: all | ||
all: image/build-and-push | ||
|
||
.ONESHELL: | ||
SHELL := /bin/bash | ||
.SHELLFLAGS = -ec | ||
|
||
IMAGE_TAG ?= localhost:5001/pdt:latest | ||
|
||
## Build and push the Docker image | ||
image/build-and-push: | ||
docker build -t "${IMAGE_TAG}" . | ||
docker push "${IMAGE_TAG}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: pdt | ||
namespace: pdt | ||
labels: | ||
"app.kubernetes.io/name": "pdt" | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
"app.kubernetes.io/name": "pdt" | ||
strategy: | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
labels: | ||
"app.kubernetes.io/name": "pdt" | ||
spec: | ||
containers: | ||
- image: pdt | ||
name: pdt | ||
ports: | ||
- containerPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- namespace.yaml | ||
- pvc.yaml | ||
- deployment.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: pdt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: pdt-pvc | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 128Gi | ||
storageClassName: standard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- ../../base | ||
|
||
namespace: pdt-staging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: "3" | ||
services: | ||
pdt: | ||
environment: | ||
RUST_BACKTRACE: 1 | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
container_name: pdt | ||
volumes: | ||
- "download_data:/var/download_data" | ||
command: | ||
- /pdt | ||
- test | ||
volumes: | ||
download_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters