Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding container support #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/docker-conf-ubuntu-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Docker JULEA Configuration

on:
push:
branches:
- master

tags:
- v*

env:
IMAGE_NAME: julea-ubuntu-config

jobs:
push-conf:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Build image
run: docker build . --file container/docker/github/Dockerfile_JULEA_Config_Ubuntu --tag $IMAGE_NAME

- name: Log into registry
run: echo "${{ secrets.GIT_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.actor }}/$IMAGE_NAME

# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')

# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')

# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')

# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest

echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION

docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
43 changes: 43 additions & 0 deletions .github/workflows/docker-deps-centos-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Docker Build JULEA Centos Dependencies

on:
release:
types: [published, edited]

env:
IMAGE_NAME: julea-centos-deps-standard

jobs:
push-deps:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Build image
run: docker build . --file container/docker/github/Dockerfile_CentOS_Deps_Standard --tag $IMAGE_NAME

- name: Log into registry
run: echo "${{ secrets.GIT_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.actor }}/$IMAGE_NAME

# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')

# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')

# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')

# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest

echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION

docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
43 changes: 43 additions & 0 deletions .github/workflows/docker-deps-ubuntu-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Docker Build JULEA Ubuntu Dependencies

on:
release:
types: [published, edited]

env:
IMAGE_NAME: julea-ubuntu-deps-standard

jobs:
push-deps:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Build image
run: docker build . --file container/docker/github/Dockerfile_Ubuntu_Deps_Standard --tag $IMAGE_NAME

- name: Log into registry
run: echo "${{ secrets.GIT_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.actor }}/$IMAGE_NAME

# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')

# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')

# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')

# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest

echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION

docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
19 changes: 19 additions & 0 deletions Singularity
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Bootstrap: library
From: ubuntu:20.04

%files
. /julea

%post
apt-get update && apt-get install -y \
build-essential \
curl \
unzip \
git \
python3

cd /julea
./scripts/install-dependencies.sh
. scripts/environment.sh
meson setup --prefix="${HOME}/julea-install" -Db_sanitize=address,undefined bld
ninja -C bld
6 changes: 6 additions & 0 deletions container/docker/client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM ghcr.io/julea-io/julea-ubuntu-config:latest

COPY docker-entrypoint.sh /entrypoint.sh

CMD ["juleaServer", "9876"]
ENTRYPOINT ["/entrypoint.sh"]
17 changes: 17 additions & 0 deletions container/docker/client/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

serverName=$1
portNumber=$2

. /julea/scripts/environment.sh

#Set environment script to .bashrc. So when exec is called with /bin/bash variables are set
sed -i -e '$a. /julea/scripts/environment.sh' ~/.bashrc

julea-config --user \
--object-servers="$serverName:$portNumber" --kv-servers="$serverName:$portNumber" --db-servers="$serverName:$portNumber" \
--object-backend=posix --object-component=server --object-path="/tmp/julea-$(id -u)/posix" \
--kv-backend=lmdb --kv-component=server --kv-path="/tmp/julea-$(id -u)/lmdb" \
--db-backend=sqlite --db-component=server --db-path="/tmp/julea-$(id -u)/sqlite"

tail -f /dev/null
10 changes: 10 additions & 0 deletions container/docker/github/Dockerfile_CentOS_Deps_Standard
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM centos:latest

COPY container/docker/github/install-centos-packages.sh .
RUN ./install-centos-packages.sh && rm install-centos-packages.sh

WORKDIR /julea
COPY scripts/ ./scripts/

SHELL ["/bin/bash", "-c"]
RUN ./scripts/install-dependencies.sh
12 changes: 12 additions & 0 deletions container/docker/github/Dockerfile_JULEA_Config_CentOS
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ghcr.io/julea-io/julea-centos-deps-standard:1.0.1

WORKDIR /julea
COPY . .

RUN yum install -y libubsan \
libasan

SHELL ["/bin/bash", "-c"]
RUN . scripts/environment.sh && \
meson setup --prefix="${HOME}/julea-install" bld && \
ninja -C bld
9 changes: 9 additions & 0 deletions container/docker/github/Dockerfile_JULEA_Config_Ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ghcr.io/julea-io/julea-ubuntu-deps-standard:1.0.0

WORKDIR /julea
COPY . .

SHELL ["/bin/bash", "-c"]
RUN . scripts/environment.sh && \
meson setup --prefix="${HOME}/julea-install" -Db_sanitize=address,undefined bld && \
ninja -C bld
10 changes: 10 additions & 0 deletions container/docker/github/Dockerfile_Ubuntu_Deps_Standard
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM ubuntu:20.04

COPY container/docker/github/install-ubuntu-packages.sh .
RUN ./install-ubuntu-packages.sh && rm install-ubuntu-packages.sh

WORKDIR /julea
COPY scripts/ ./scripts/

SHELL ["/bin/bash", "-c"]
RUN ./scripts/install-dependencies.sh
16 changes: 16 additions & 0 deletions container/docker/github/install-centos-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

yum update -y
yum -y install \
gcc \
gcc-c++ \
make \
curl \
unzip \
python3 \
git \
patch \
bzip2

yum clean all
rm -rf /var/cache/yum
14 changes: 14 additions & 0 deletions container/docker/github/install-ubuntu-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

export DEBIAN_FRONTEND=noninteractive

apt-get update
apt-get -y install --no-install-recommends \
build-essential \
curl \
unzip \
python3

apt-get -y install git

rm -rf /var/lib/apt/lists/*
7 changes: 7 additions & 0 deletions container/docker/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ghcr.io/julea-io/julea-ubuntu-config:latest

COPY docker-entrypoint.sh /entrypoint.sh
EXPOSE 9876/tcp

CMD ["juleaServer", "9876"]
ENTRYPOINT ["/entrypoint.sh"]
16 changes: 16 additions & 0 deletions container/docker/server/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

serverName=$1
portNumber=$2

. /julea/scripts/environment.sh

sed -i -e '$a. /julea/scripts/environment.sh' ~/.bashrc

julea-config --user \
--object-servers="$serverName:$portNumber" --kv-servers="$serverName:$portNumber" --db-servers="$serverName:$portNumber" \
--object-backend=posix --object-component=server --object-path="/tmp/julea-$(id -u)/posix" \
--kv-backend=lmdb --kv-component=server --kv-path="/tmp/julea-$(id -u)/lmdb" \
--db-backend=sqlite --db-component=server --db-path="/tmp/julea-$(id -u)/sqlite"

julea-server --host "$serverName" --port $portNumber
8 changes: 8 additions & 0 deletions container/singularity/client/Singularity
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Bootstrap: docker
From: ghcr.io/julea-io/julea-ubuntu-config:latest

%files
singularity-entrypoint.sh /singularity-entrypoint.sh

%startscript
/bin/bash /singularity-entrypoint.sh
10 changes: 10 additions & 0 deletions container/singularity/client/singularity-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

. /julea/scripts/environment.sh

julea-config --user \
--object-servers="juleaserver:9876" --kv-servers="juleaserver:9876" --db-servers="juleaserver:9876" \
--object-backend=posix --object-component=server --object-path="/singularity-mnt/julea-$(id -u)/posix" \
--kv-backend=lmdb --kv-component=server --kv-path="/singularity-mnt/julea-$(id -u)/lmdb" \
--db-backend=sqlite --db-component=server --db-path="/singularity-mnt/julea-$(id -u)/sqlite"

Empty file.
8 changes: 8 additions & 0 deletions container/singularity/server/Singularity
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Bootstrap: docker
From: ghcr.io/julea-io/julea-ubuntu-config:latest

%files
singularity-entrypoint.sh /singularity-entrypoint.sh

%startscript
/bin/bash /singularity-entrypoint.sh
11 changes: 11 additions & 0 deletions container/singularity/server/singularity-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

. /julea/scripts/environment.sh

julea-config --user \
--object-servers="localhost:9876" --kv-servers="localhost:9876" --db-servers="localhost:9876" \
--object-backend=posix --object-component=server --object-path="/singularity-mnt/julea-$(id -u)/posix" \
--kv-backend=lmdb --kv-component=server --kv-path="/singularity-mnt/julea-$(id -u)/lmdb" \
--db-backend=sqlite --db-component=server --db-path="/singularity-mnt/julea-$(id -u)/sqlite"

julea-server --daemon --host "localhost" --port "9876"
Empty file.
1 change: 1 addition & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ Its goal is to provide a solid foundation for storage research and teaching.
* [Debugging](debugging.md)
* [Implementing a Backend](implementing-backend.md)
* [HDF5 Support](hdf5.md)
* [Container Support](container.md)
Loading