Skip to content

Commit

Permalink
Merge pull request #137 from jbernal0019/master
Browse files Browse the repository at this point in the history
Implement pfcon in-network operation mode
  • Loading branch information
jbernal0019 committed Jul 21, 2023
2 parents b91013a + 138ac1a commit abfa2bc
Show file tree
Hide file tree
Showing 19 changed files with 1,140 additions and 264 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ Dockerfile
.git
LICENSE
CHRIS_REMOTE_FS
swift_storage
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@

dc.out
CHRIS_REMOTE_FS/
swift_storage/
33 changes: 33 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ Remove pfcon's containers
$> cd pfcon
$> ./unmake.sh
Start pfcon's development server and backend containers operating in-network (with Swift storage)
-------------------------------------------------------------------------------------------------

.. code-block:: bash
$> cd pfcon
$> ./make.sh -N
Remove pfcon's containers operating in-network (with Swift storage)
-------------------------------------------------------------------

.. code-block:: bash
$> cd pfcon
$> ./unmake.sh -N
Remove the local Docker Swarm cluster if desired
------------------------------------------------

Expand Down Expand Up @@ -132,6 +148,23 @@ Remove pfcon's containers
$> ./unmake.sh -O kubernetes
Start pfcon's development server and backend containers operating in-network (with Swift storage)
-------------------------------------------------------------------------------------------------

.. code-block:: bash
$> cd pfcon
$> ./make.sh -N -O kubernetes
Remove pfcon's containers operating in-network (with Swift storage)
-------------------------------------------------------------------

.. code-block:: bash
$> cd pfcon
$> ./unmake.sh -N -O kubernetes
**********************
Production deployments
**********************
Expand Down
4 changes: 3 additions & 1 deletion kubernetes/pfcon_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
image: busybox:1.32
command: [ 'sh', '-c', "until wget --spider -S -T 2 http://pman:5010/api/v1/ 2>&1 | grep '200 OK'; do echo waiting for pman; done" ]
containers:
- image: fnndsc/pfcon:dev
- image: localhost:5000/fnndsc/pfcon:dev
name: pfcon
stdin: true
tty: true
Expand Down Expand Up @@ -119,6 +119,8 @@ spec:
# (where pfcon shares the data) into the spawned container. This directory is
# passed in the STOREBASE env variable.
env:
- name: STORAGE_TYPE
value: host
- name: SECRET_KEY
value: "anysu^l=@pnsf!5piqz6!!5kdcdpo79y6jebbp+2244yjm*#+k"
- name: STOREBASE
Expand Down
191 changes: 191 additions & 0 deletions kubernetes/pfcon_dev_innetwork.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
apiVersion: v1
kind: Service
metadata:
name: pfcon
labels:
app: pfcon
env: development
spec:
type: NodePort
selector:
app: pfcon
env: development
ports:
- port: 30006
targetPort: 5005
nodePort: 30006

---

apiVersion: apps/v1
kind: Deployment
metadata:
name: pfcon
labels:
app: pfcon
env: development
spec:
replicas: 1
selector:
matchLabels:
app: pfcon
env: development
template:
metadata:
name: pfcon
labels:
app: pfcon
env: development
spec:
initContainers:
- name: init-pfcon
image: busybox:1.32
command: [ 'sh', '-c', "until wget --spider -S -T 2 http://pman:5010/api/v1/ 2>&1 | grep '200 OK'; do echo waiting for pman; done" ]
- name: init-swift
image: busybox:1.32
command: [ "sh", "-c", "until wget --spider -S -T 2 http://swift:8080/info 2>&1 | grep '200 OK'; do echo waiting for Swift storage; sleep2; done" ]
containers:
- image: fnndsc/pfcon:dev
name: pfcon
stdin: true
tty: true
ports:
- containerPort: 5005
env:
- name: APPLICATION_MODE
value: development
command: ["python"]
args: ["-m", "pfcon"]
volumeMounts:
- mountPath: "/var/local/storeBase"
name: "storebase"
- mountPath: "/app/pfcon"
name: "pfcon-source"
- mountPath: "/app/tests"
name: "pfcon-tests"
volumes:
- name: "storebase"
hostPath:
path: ${STOREBASE}
- name: "pfcon-source"
hostPath:
path: ${SOURCEDIR}/pfcon
- name: "pfcon-tests"
hostPath:
path: ${SOURCEDIR}/tests

---

apiVersion: v1
kind: Service
metadata:
name: pman
labels:
app: pman
env: production
spec:
selector:
app: pman
env: production
ports:
- port: 5010
targetPort: 5010

---

apiVersion: apps/v1
kind: Deployment
metadata:
name: pman
labels:
app: pman
env: production
spec:
replicas: 1
selector:
matchLabels:
app: pman
env: production
template:
metadata:
name: pman
labels:
app: pman
env: production
spec:
containers:
- image: fnndsc/pman
name: pman
ports:
- containerPort: 5010
# Since pman spins off containers of its own it needs to mount storeBase dir
# (where pfcon shares the data) into the spawned container. This directory is
# passed in the STOREBASE env variable.
env:
- name: STORAGE_TYPE
value: host
- name: SECRET_KEY
value: "anysu^l=@pnsf!5piqz6!!5kdcdpo79y6jebbp+2244yjm*#+k"
- name: STOREBASE
value: ${STOREBASE}
- name: CONTAINER_ENV
value: kubernetes

---

apiVersion: v1
kind: Service
metadata:
name: swift
labels:
app: swift
env: production
spec:
type: NodePort
selector:
app: swift
env: production
ports:
- port: 8080
targetPort: 8080
nodePort: 30080

---

apiVersion: apps/v1
kind: Deployment
metadata:
name: swift
labels:
app: swift
env: production
spec:
replicas: 1 # stateful service, so only a single replica must be used
selector:
matchLabels:
app: swift
env: production
template:
metadata:
name: swift
labels:
app: swift
env: production
spec:
containers:
- name: swift
image: fnndsc/docker-swift-onlyone
ports:
- containerPort: 8080
env:
- name: SWIFT_USERNAME
value: chris:chris1234
- name: SWIFT_KEY
value: testing
volumeMounts:
- name: swiftdb
mountPath: "/srv"
volumes:
- name: swiftdb
hostPath:
path: ${SOURCEDIR}/swift_storage
Loading

0 comments on commit abfa2bc

Please sign in to comment.