Dockerfile for containerized FAHClient rootless and K8S ready to help Folding@Home project research against COVID-19
Using CentOS8 Base image on master branch for compatibility with their available RPM
We put our image on Quay.io public registry that you can use to pull the image. Quay has also build triggers and updates this image for each changes we push.
https://quay.io/repository/redhat-emea-ssa-team/fahclient-container
$ docker build .
$ buildah bud -t fahclient-centos8 .
$ docker pull quay.io/redhat-emea-ssa-team/fahclient-container:latest
$ docker run --rm --name fahclient-centos8 -e USER=<YOUR_FAH_USERNAME> -e PASSKEY=<YOUR_FAH_PASSKEY> -e TEAM=<YOUR_TEAM_ID> -e POWER=<light|medium|full> -e GPU=<false|true> -ti quay.io/redhat-emea-ssa-team/fahclient-container:latest
Get the IP to connect
$ docker inspect --format '{{ .NetworkSettings.IPAddress }}' fahclient-centos8
Browse to http://<IP>:7396
$ podman pull quay.io/redhat-emea-ssa-team/fahclient-container:latest
$ podman run --rm --name fahclient-centos8 -P -e USER=<YOUR_FAH_USERNAME> -e PASSKEY=<YOUR_FAH_PASSKEY> -e TEAM=<YOUR_TEAM_ID> -e POWER=<light|medium|full> -e GPU=<false|true> -ti quay.io/redhat-emea-ssa-team/fahclient-container:latest
Get port to connect to WebUI
$ podman port -l
7396/tcp -> 0.0.0.0:33675
Browse to http://localhost:<PORT>
If you run it on Kubernetes you have to take in consideration Anti-Affinity policy of Pod replicas scheduling, in this computation model it is more effective the vertical scaling rather than horizontal one.
$ oc new-app https://github.com/RedHat-EMEA-SSA-Team/fahclient-container.git --name fahclient-centos8 --env TEAM=<YOUR_TEAM_ID> --env GPU=<false|true>
Access the WebUI via OpenShift Route:
$ oc expose svc/fahclient-centos8
Browse to: http://fahclient-centos8-<PROJECT_NAME>.apps.<CLUSTER_DOMAIN>
Build the Container Image and push it to your registry, then deploy it.
Example:
apiVersion: apps/v1
kind: Deployment
metadata:
name: fahclient-centos8-deployment
labels:
app: fahclient-centos8
spec:
replicas: 1
selector:
matchLabels:
app: fahclient-centos8
template:
metadata:
labels:
app: fahclient-centos8
spec:
containers:
- name: fahclient-centos8
env:
- name: TEAM
value: '11812'
- name: GPU
value: 'false'
image: quay.io/redhat-emea-ssa-team/fahclient-container:latest
ports:
- containerPort: 7396
Run it with kubectl (using default values for ENV):
$ kubectl create -f deployment.yaml
If you want to join our Redhat team you can just our team id 11812 in your container environment, or just in your config.xml if you don't use it as container.