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

feat(base): change base to SeaweedFS #1

Merged
merged 7 commits into from
Jan 22, 2024
Merged
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
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
andrewazores marked this conversation as resolved.
Show resolved Hide resolved
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"
]
}
]
}