Skip to content

Commit

Permalink
feat(base): change base to SeaweedFS (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores authored Jan 22, 2024
2 parents 9a72527 + 4b69e2c commit 528cb40
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ concurrency:

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 1' # every Monday at midnight
push:
branches:
- main
Expand Down
24 changes: 16 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
FROM docker.io/minio/minio:RELEASE.2023-12-14T18-51-57Z
ARG builder_version=8.9
ARG runner_version=8.9

ENV MINIO_USER minio
ENV MINIO_UID_GID 5001
FROM registry.access.redhat.com/ubi8/ubi:${builder_version} AS builder
ARG ref=master
RUN dnf install -y go git make gettext \
&& pushd /root \
&& git clone --depth 1 --branch $ref https://github.com/seaweedfs/seaweedfs \
&& pushd seaweedfs/weed \
&& make install \
&& popd \
&& popd

RUN echo "${MINIO_USER}:x:${MINIO_UID_GID}:${MINIO_UID_GID}:${MINIO_USER}:/home/${MINIO_USER}:/sbin/nologin" >> /etc/passwd && \
echo "${MINIO_USER}:x:${MINIO_UID_GID}:" >> /etc/group && \
mkdir "/home/${MINIO_USER}"

USER 5001
FROM registry.access.redhat.com/ubi8/ubi-micro:${runner_version}
COPY --from=builder /usr/bin/envsubst /root/go/bin/weed /root/seaweedfs/docker/entrypoint.sh /usr/bin/
COPY ./cryostat-entrypoint.bash /usr/bin/
COPY seaweed_conf.template.json /etc/seaweed_conf.template.json
ENTRYPOINT ["/usr/bin/cryostat-entrypoint.bash"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Image Repository on Quay](https://quay.io/repository/cryostat/cryostat-storage/status "Image Repository on Quay")](https://quay.io/repository/cryostat/cryostat-storage)
[![Google Group : Cryostat Development](https://img.shields.io/badge/Google%20Group-Cryostat%20Development-blue.svg)](https://groups.google.com/g/cryostat-development)

This is a lightly customized [Minio](https://github.com/minio/minio) storage image for use by [cryostat](https://github.com/cryostatio/cryostat3).
This is a lightly customized [SeaweedFS](https://github.com/seaweedfs/seaweedfs) storage image for use by [cryostat](https://github.com/cryostatio/cryostat3).

## CONTRIBUTING

Expand Down
21 changes: 21 additions & 0 deletions cryostat-entrypoint.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

if [ -z "${CRYOSTAT_ACCESS_KEY}" ]; then
echo 'CRYOSTAT_ACCESS_KEY must be set and non-empty'
exit 1
fi

if [ -z "${CRYOSTAT_SECRET_KEY}" ]; then
echo 'CRYOSTAT_SECRET_KEY must be set and non-empty'
exit 2
fi

set -xe

cfg="$(mktemp)"
envsubst '$CRYOSTAT_ACCESS_KEY $CRYOSTAT_SECRET_KEY' < /etc/seaweed_conf.template.json > "${cfg}"

exec /usr/bin/entrypoint.sh \
server -dir="${DATA_DIR:-/tmp}" \
-s3 -s3.config="${cfg}" \
"$@"
28 changes: 28 additions & 0 deletions seaweed_conf.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"identities": [
{
"name": "anonymous",
"actions": [
"Read"
]
},
{
"name": "cryostat",
"credentials": [
{
"accessKey": "$CRYOSTAT_ACCESS_KEY",
"secretKey": "$CRYOSTAT_SECRET_KEY"
}
],
"actions": [
"Admin",
"Read",
"ReadAcp",
"List",
"Tagging",
"Write",
"WriteAcp"
]
}
]
}

0 comments on commit 528cb40

Please sign in to comment.