Skip to content

Commit 924a44c

Browse files
committed
add flux-core container build
not multi-stage build yet because we do not have copy view, only symlink Signed-off-by: vsoch <[email protected]>
1 parent 588ea0a commit 924a44c

File tree

4 files changed

+71
-7
lines changed

4 files changed

+71
-7
lines changed

.github/workflows/build-container.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Deploy Container
1+
name: Build and Deploy Containers
22

33
on:
44

@@ -31,9 +31,8 @@ jobs:
3131
matrix:
3232

3333
# Dockerfiles to build, a matrix supports future expanded builds
34-
container: [["etc/docker/Dockerfile.base", "ghcr.io/flux-framework/flux-core-base"]]
35-
# This will be enabled after the first container builds.
36-
#["config/docker/Dockerfile", "ghcr.io/flux-framework/flux-core-ubuntu"]]
34+
container: [["etc/docker/Dockerfile.base", "ghcr.io/flux-framework/flux-core-base"],
35+
["etc/docker/Dockerfile", "ghcr.io/flux-framework/flux-core-ubuntu"]]
3736

3837
runs-on: ubuntu-latest
3938
name: Build

etc/docker/Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM ghcr.io/flux-framework/flux-core-base:latest as builder
2+
3+
# docker build -f etc/docker/Dockerfile -t ghcr.io/flux-framework/flux-core-ubuntu .
4+
5+
# The development config cannot have git@ clone, must be https
6+
COPY ./etc/docker/git-config /code/.git/config
7+
8+
# Get upstream tags for version (otherwise won't build)
9+
WORKDIR /code
10+
RUN git fetch
11+
RUN cd /opt/flux-env && \
12+
. /opt/spack/share/spack/setup-env.sh && \
13+
spack env activate . && \
14+
spack install && \
15+
spack env view regenerate
16+
17+
# We can't do multistage build on a view symlink
18+
# FROM ubuntu:22.04
19+
# COPY --from=builder /opt/view /opt/view
20+
# COPY --from=builder /opt/flux-view /opt/flux-view
21+
22+
RUN apt-get update && \
23+
apt-get install -y unzip gfortran python3-dev && \
24+
apt-get install -y libcurl4-openssl-dev libssl-dev
25+
26+
ENV PATH=$PATH:/opt/flux-view/bin
27+
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/flux-view/lib:/opt/flux-view/lib64
28+
ENV DEBIAN_FRONTEND=noninteractive
29+
30+
# The user will see the view on shell into the container
31+
WORKDIR /opt/
32+
ENTRYPOINT ["/bin/bash"]

etc/docker/README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Flux Core Docker
22

33
We provide a [Dockerfile.base](Dockerfile.base) to build an ubuntu base image,
4-
and (will provide) a `Dockerfile` to build a smaller one with a multi-stage build. 🚧️
4+
and a [Dockerfile](Dockerfile) to build a smaller one with a multi-stage build (TBA). 🚧️
55

66
Updated containers are built and deployed on merges to the master branch and releases.
77
If you want to request a build on demand, you can [manually run the workflow](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow) thanks to the workflow dispatch event.
88

99
### Usage
1010

11-
Here is how to build the container. Note that we build so it belongs to the same
11+
Here is how to build the base container. Note that we build so it belongs to the same
1212
namespace as the repository here. "ghcr.io" means "GitHub Container Registry" and
1313
is the [GitHub packages](https://github.com/features/packages) registry that supports
1414
Docker images and other OCI artifacts. From the root of the repository:
@@ -17,4 +17,25 @@ is the [GitHub packages](https://github.com/features/packages) registry that sup
1717
$ docker build -f etc/docker/Dockerfile.base -t ghcr.io/flux-framework/flux-core-base .
1818
```
1919

20-
**More will be added when the final flux container is developed**
20+
And then to build the flux-core container (also from the root):
21+
22+
```bash
23+
$ docker build -f etc/docker/Dockerfile -t ghcr.io/flux-framework/flux-core-ubuntu .
24+
```
25+
26+
### Shell
27+
28+
To shell into the container:
29+
30+
```bash
31+
$ docker run -it ghcr.io/flux-framework/flux-core-ubuntu
32+
```
33+
34+
Flux (and other executables) should be installed to the view:
35+
36+
```bash
37+
# which flux
38+
/opt/flux-view/bin/flux
39+
```
40+
41+
You could next follow the [flux-tutorial](https://flux-framework.readthedocs.io/en/latest/quickstart.html#starting-a-flux-instance) to launch a job!

etc/docker/git-config

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[core]
2+
repositoryformatversion = 0
3+
filemode = true
4+
bare = false
5+
logallrefupdates = true
6+
[remote "origin"]
7+
url = https://github.com/flux-framework/flux-core
8+
fetch = +refs/heads/*:refs/remotes/origin/*
9+
[branch "master"]
10+
remote = origin
11+
merge = refs/heads/master
12+

0 commit comments

Comments
 (0)