Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FWCC
Slurm in Docker
Commits
e19df8ed
Commit
e19df8ed
authored
Dec 13, 2019
by
Pape, David (FWCC) - 139658
Browse files
Providing latest tag, updating README.md.
parent
f5e04eee
Pipeline
#19755
failed with stages
in 10 minutes and 21 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
e19df8ed
FROM
fedora:
31
FROM
fedora:
latest
RUN
dnf upgrade
-y
&&
\
dnf
install
-y
\
...
...
Makefile
View file @
e19df8ed
CONTAINER_NAME
=
registry.hzdr.de/pape58/slurm-in-docker
CONTAINER_TAG
=
fedora-31
CONTAINER
=
${CONTAINER_NAME}
:
${CONTAINER_TAG}
CONTAINER_TAGS
=
latest fedora-latest
CONTAINER
=
$(CONTAINER_NAME)
:
$(
firstword
$(CONTAINER_TAGS)
)
CONTAINER_LIST
=
$(
foreach
tag,
$(CONTAINER_TAGS)
,
$(CONTAINER_NAME)
:
$(tag)
)
.PHONY
:
build push run
build
:
Dockerfile docker-entrypoint.sh
docker build
-t
${CONTAINER}
.
docker build
$(
foreach
c,
$(CONTAINER_LIST)
,-t
$(c)
)
.
push
:
build
docker push
$
{
CONTAINER
}
docker push
$
(
CONTAINER
_LIST)
run
:
build
docker run
-ti
--rm
$
{
CONTAINER
}
docker run
-ti
--rm
$
(
CONTAINER
)
README.md
View file @
e19df8ed
...
...
@@ -13,42 +13,52 @@ hyperthreading, ...). The *cluster* (if you want to call your single node that)
When you start the container, the services are already up and running. You will be greeted by a Bash
shell running as
`root`
.
## Building and running the container
If you have Docker set up on your system, you can easily start the container by executing
`make run`
. This will automatically build and tag the image for you. The first build may take a few
minutes.
The default target for make is
`build`
. This will build the container using the name and tag
specified at the top of the Makefile. If you wish to give the container a different name, you can
pass it to
`make`
as an argument, e.g.
`make CONTAINER=slurm`
.
## Just running the container
## Running the container
If you don't want to build the container yourself, you can pull it from HZDR's registry. (Remember
to log in and out!)
```
bash
docker login registry.hzdr.de
docker pull registry.hzdr.de/pape58/slurm-in-docker
:fedora-31
docker pull registry.hzdr.de/pape58/slurm-in-docker
docker
logout
registry.hzdr.de
```
To run the container use this command:
```
bash
docker run
-ti
--rm
registry.hzdr.de/pape58/slurm-in-docker
:fedora-31
docker run
-ti
--rm
registry.hzdr.de/pape58/slurm-in-docker
```
The image is updated weekly.
## Building the container
If you have Docker set up on your system, you can easily build the container by executing
`make`
.
This will run the default target
`build`
which builds and tags the image for you. The first build
may take a few minutes.
The default name of the container is
`registry.hzdr.de/pape58/slurm-in-docker`
. If you want to
choose a shorter name, you can pass it as an argument when building the container, e.g.
```
bash
make
CONTAINER_NAME
=
slurm
```
Verify the build worked:
```
bash
docker image
ls
```
## Using it in your CI job
... is as easy as
... is as easy as specifying
`image: registry.hzdr.de/pape58/slurm-in-docker`
. GitLab will pull it
from the registry for you and place your job inside of a new container. Here is an example job:
```
yml
my_job
:
image
:
registry.hzdr.de/pape58/slurm-in-docker
:fedora-31
image
:
registry.hzdr.de/pape58/slurm-in-docker
script
:
-
srun -n 2 hostname
```
...
...
@@ -56,10 +66,10 @@ my_job:
## Running other programs
You can pass any program name to the container. At the moment, there are not a lot of programs
installed on it, though. Feel free to
wr
it
e
an issue or
provide
a merge request if you have any
installed on it, though. Feel free to
subm
it an issue or a merge request if you have any
suggestions.
```
bash
docker run
-
i
t
--rm
registry.hzdr.de/pape58/slurm-in-docker
:fedora-31
ps
f
aux
docker run
-t
i
--rm
registry.hzdr.de/pape58/slurm-in-docker ps aux
```
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment