-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial version of NFS mounted volumes
- Loading branch information
Showing
10 changed files
with
364 additions
and
3 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
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
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,117 @@ | ||
version: '3.1' | ||
|
||
services: | ||
nfs-server: | ||
build: | ||
context: ./nfs-server | ||
dockerfile: Dockerfile | ||
image: nfs-server | ||
container_name: nfs-server | ||
privileged: true | ||
hostname: nfs-server.local.dev | ||
networks: | ||
- slurm | ||
environment: | ||
RPCNFSDCOUNT: 16 | ||
NFS_SERVER_DIRS: '/nfs/secret:/nfs/home:/nfs/modules:/nfs/modulefiles' | ||
volumes: | ||
- nfs-vol:/nfs | ||
|
||
controller: | ||
build: | ||
context: ./controller | ||
dockerfile: Dockerfile | ||
image: scidas/slurm.controller:17.11.5 | ||
container_name: controller | ||
privileged: true | ||
restart: always | ||
hostname: controller.local.dev | ||
networks: | ||
- slurm | ||
environment: | ||
USE_SLURMDBD: 'true' | ||
CLUSTER_NAME: snowflake | ||
CONTROL_MACHINE: controller | ||
SLURMCTLD_PORT: 6817 | ||
SLURMD_PORT: 6818 | ||
ACCOUNTING_STORAGE_HOST: database | ||
ACCOUNTING_STORAGE_PORT: 6819 | ||
COMPUTE_NODES: worker01 worker02 | ||
PARTITION_NAME: docker | ||
NFS_SERVER: nfs-server | ||
NFS_SERVER_DIRS: '/nfs/secret:/nfs/home:/nfs/modules:/nfs/modulefiles' | ||
NFS_CLIENT_DIRS: '/.secret:/home:/opt/apps/Linux:/opt/apps/modulefiles/Linux' | ||
|
||
database: | ||
build: | ||
context: ./database | ||
dockerfile: Dockerfile | ||
image: scidas/slurm.database:17.11.5 | ||
depends_on: | ||
- controller | ||
container_name: database | ||
privileged: true | ||
restart: always | ||
hostname: database.local.dev | ||
networks: | ||
- slurm | ||
environment: | ||
DBD_ADDR: database | ||
DBD_HOST: database | ||
DBD_PORT: 6819 | ||
STORAGE_HOST: database.local.dev | ||
STORAGE_PORT: 3306 | ||
STORAGE_PASS: password | ||
STORAGE_USER: slurm | ||
NFS_SERVER: nfs-server | ||
NFS_SERVER_DIRS: '/nfs/secret:/nfs/home:/nfs/modules:/nfs/modulefiles' | ||
NFS_CLIENT_DIRS: '/.secret:/home:/opt/apps/Linux:/opt/apps/modulefiles/Linux' | ||
|
||
worker01: | ||
build: | ||
context: ./worker | ||
dockerfile: Dockerfile | ||
image: scidas/slurm.worker:17.11.5 | ||
depends_on: | ||
- controller | ||
container_name: worker01 | ||
privileged: true | ||
restart: always | ||
hostname: worker01.local.dev | ||
networks: | ||
- slurm | ||
environment: | ||
CONTROL_MACHINE: controller | ||
ACCOUNTING_STORAGE_HOST: database | ||
COMPUTE_NODES: worker01 worker02 | ||
NFS_SERVER: nfs-server | ||
NFS_SERVER_DIRS: '/nfs/secret:/nfs/home:/nfs/modules:/nfs/modulefiles' | ||
NFS_CLIENT_DIRS: '/.secret:/home:/opt/apps/Linux:/opt/apps/modulefiles/Linux' | ||
|
||
worker02: | ||
build: | ||
context: ./worker | ||
dockerfile: Dockerfile | ||
image: scidas/slurm.worker:17.11.5 | ||
depends_on: | ||
- controller | ||
container_name: worker02 | ||
privileged: true | ||
restart: always | ||
hostname: worker02.local.dev | ||
networks: | ||
- slurm | ||
environment: | ||
CONTROL_MACHINE: controller | ||
ACCOUNTING_STORAGE_HOST: database | ||
COMPUTE_NODES: worker01 worker02 | ||
NFS_SERVER: nfs-server | ||
NFS_SERVER_DIRS: '/nfs/secret:/nfs/home:/nfs/modules:/nfs/modulefiles' | ||
NFS_CLIENT_DIRS: '/.secret:/home:/opt/apps/Linux:/opt/apps/modulefiles/Linux' | ||
|
||
networks: | ||
slurm: | ||
|
||
volumes: | ||
nfs-vol: | ||
external: true |
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,17 @@ | ||
FROM krallin/centos-tini:7 | ||
MAINTAINER Michael J. Stealey <[email protected]> | ||
|
||
RUN rpmkeys --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ | ||
yum -y --setopt=tsflags=nodocs install nfs-utils && \ | ||
mkdir -p /nfs && \ | ||
yum clean all | ||
|
||
ENV RPCNFSDCOUNT=8 \ | ||
NFS_SERVER_DIRS='/nfs/share' | ||
|
||
COPY docker-entrypoint.sh /docker-entrypoint.sh | ||
|
||
VOLUME ["/nfs"] | ||
EXPOSE 111/udp 2049/tcp | ||
|
||
ENTRYPOINT ["/usr/local/bin/tini", "--", "/docker-entrypoint.sh"] |
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,93 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
_start_nfs() { | ||
exportfs -a | ||
rpcbind | ||
rpc.statd | ||
rpc.nfsd | ||
rpc.mountd | ||
} | ||
|
||
_nfs_server_mounts() { | ||
IFS=':' read -r -a MNT_SERVER_ARRAY <<< "$NFS_SERVER_DIRS" | ||
for server_mnt in "${MNT_SERVER_ARRAY[@]}"; do | ||
if [[ ! -d $server_mnt ]]; then | ||
mkdir -p $server_mnt | ||
fi | ||
chmod -R 777 $server_mnt | ||
cat >> /etc/exports <<EOF | ||
${server_mnt} *(rw,sync,no_subtree_check,no_root_squash,fsid=$(( ( RANDOM % 100 ) + 200 ))) | ||
EOF | ||
done | ||
cat /etc/exports | ||
} | ||
|
||
_sysconfig_nfs() { | ||
cat > /etc/sysconfig/nfs <<EOF | ||
# | ||
# | ||
# To set lockd kernel module parameters please see | ||
# /etc/modprobe.d/lockd.conf | ||
# | ||
# Optional arguments passed to rpc.nfsd. See rpc.nfsd(8) | ||
RPCNFSDARGS="" | ||
# Number of nfs server processes to be started. | ||
# The default is 8. | ||
RPCNFSDCOUNT=${RPCNFSDCOUNT} | ||
# | ||
# Set V4 grace period in seconds | ||
#NFSD_V4_GRACE=90 | ||
# | ||
# Set V4 lease period in seconds | ||
#NFSD_V4_LEASE=90 | ||
# | ||
# Optional arguments passed to rpc.mountd. See rpc.mountd(8) | ||
RPCMOUNTDOPTS="" | ||
# Port rpc.mountd should listen on. | ||
#MOUNTD_PORT=892 | ||
# | ||
# Optional arguments passed to rpc.statd. See rpc.statd(8) | ||
STATDARG="" | ||
# Port rpc.statd should listen on. | ||
#STATD_PORT=662 | ||
# Outgoing port statd should used. The default is port | ||
# is random | ||
#STATD_OUTGOING_PORT=2020 | ||
# Specify callout program | ||
#STATD_HA_CALLOUT="/usr/local/bin/foo" | ||
# | ||
# | ||
# Optional arguments passed to sm-notify. See sm-notify(8) | ||
SMNOTIFYARGS="" | ||
# | ||
# Optional arguments passed to rpc.idmapd. See rpc.idmapd(8) | ||
RPCIDMAPDARGS="" | ||
# | ||
# Optional arguments passed to rpc.gssd. See rpc.gssd(8) | ||
# Note: The rpc-gssd service will not start unless the | ||
# file /etc/krb5.keytab exists. If an alternate | ||
# keytab is needed, that separate keytab file | ||
# location may be defined in the rpc-gssd.service's | ||
# systemd unit file under the ConditionPathExists | ||
# parameter | ||
RPCGSSDARGS="" | ||
# | ||
# Enable usage of gssproxy. See gssproxy-mech(8). | ||
GSS_USE_PROXY="yes" | ||
# | ||
# Optional arguments passed to blkmapd. See blkmapd(8) | ||
BLKMAPDARGS="" | ||
EOF | ||
} | ||
|
||
### main ### | ||
_sysconfig_nfs | ||
_nfs_server_mounts | ||
_start_nfs | ||
|
||
rpcinfo -p | ||
showmount -e | ||
|
||
tail -f /dev/null |
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
Oops, something went wrong.