Skip to content
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
34 changes: 34 additions & 0 deletions .github/workflows/docker-image-rhel10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Docker Image CI

on:
schedule:
- cron: '0 6 * * *'
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Docker login
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin
- name: Docker build
run: docker build . --file Dockerfile.rhel10 --tag fmidev/smartmetserver-rhel10:latest
- name: Docker test
run: |
docker run --name test --rm -p 127.0.0.1:8080:8080 fmidev/smartmetserver-rhel10:latest &> debug.log &
sleep 45
cat debug.log
docker logs test
curl -f "http://localhost:8080/wms?request=getCapabilities&service=WMS" || exit 1
docker stop test
- name: Docker tag
run: docker image tag fmidev/smartmetserver-rhel10:latest fmidev/smartmetserver-rhel10:$(date +%y.%m.%d -d @$(docker run --rm fmidev/smartmetserver-rhel10:latest rpm -qa --queryformat %'{buildtime}\n' smartmet-*|sort -n|tail -1))
# - name: Docker push
# run: docker push --all-tags fmidev/smartmetserver-rhel10
12 changes: 2 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
# Development tools
actionlint
debug.log

# Editor files
*~
*.swp
*.swo
.vscode/
.idea/
/debug.log
/debug10.log
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ RUN dnf -y install https://download.fmi.fi/smartmet-open/rhel/9/x86_64/smartmet-
dnf -y module disable postgresql:15 && \
sed -i -e 's/^mirrorlist=/#mirrorlist=/' -e 's/^#baseurl=/baseurl=/' /etc/yum.repos.d/rocky.repo && \
dnf -y update && \
dnf -y install jemalloc && \
dnf -y install --setopt=install_weak_deps=False \
smartmet-plugin-admin \
smartmet-plugin-autocomplete \
Expand Down
59 changes: 59 additions & 0 deletions Dockerfile.rhel10
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
FROM rockylinux/rockylinux:10
LABEL maintainer "Mikko Rauhala <mikko.rauhala@fmi.fi>"
LABEL license "MIT License Copyright (c) 2023 FMI Open Development"

ENV USER_NAME="smartmet" \
GOOGLE_FONTS="Montserrat NotoSans OpenSans Roboto"

RUN dnf -y install https://download.fmi.fi/smartmet-open/rhel/10/x86_64/smartmet-open-release-latest-10.noarch.rpm && \
dnf -y install smartmet-open-beta && \
dnf -y install yum-utils && \
dnf config-manager --set-enabled crb && \
dnf -y install epel-release && \
dnf config-manager --setopt="epel.exclude=librsvg2*" --save && \
dnf config-manager --setopt="baseos.exclude=librsvg2*" --save && \
dnf config-manager --setopt="epel.exclude=eccodes*" --save && \
dnf config-manager --set-disabled epel-source && \
dnf -y update && \
dnf -y install jemalloc && \
dnf -y install --setopt=install_weak_deps=False \
smartmet-plugin-autocomplete \
smartmet-plugin-backend \
smartmet-plugin-download \
smartmet-plugin-edr \
smartmet-plugin-timeseries \
smartmet-plugin-wms \
smartmet-engine-grid \
smartmet-engine-observation \
smartmet-library-tron \
smartmet-plugin-q3 \
lua-newcairo-q3 \
unzip \
glibc-langpack-en && \
dnf -y reinstall --setopt=override_install_langs='' --setopt=tsflags='' glibc-common eccodes && \
dnf clean all

HEALTHCHECK --interval=30s --timeout=10s \
CMD curl -f http://localhost:8080/admin?what=qengine || exit 1

# Expose SmartMet Server's default port
EXPOSE 8080

RUN mkdir -p /smartmet/data/{meps,hirlam,gfs,meteor,nam,icon,gem,gens-avg,gens-ctrl,hbm,wam,aws}/{surface,pressure} \
/smartmet/share/wms

RUN install -m 775 -g 0 -d /var/smartmet
RUN install -m 775 -g 0 -d /var/smartmet/archivecache

RUN chmod -R g=u /etc/passwd

COPY smartmetconf /etc/smartmet
COPY share/edr /usr/share/smartmet/edr
COPY wms /smartmet/share/wms
COPY docker-entrypoint.sh /

### Containers should NOT run as root as a good practice
USER 101010

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["smartmetd"]
36 changes: 36 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

build:
$(MAKE) clean
docker build . --file Dockerfile --tag fmidev/smartmetserver:latest --no-cache

test:
docker rm -f test 2>/dev/null || true
docker run --name test --rm -p 127.0.0.1:8080:8080 fmidev/smartmetserver:latest &> debug.log &
# Wait for the server to start
sleep 45s
# Check if the server is running
curl -f "http://localhost:8080/wms?request=getCapabilities&service=WMS" || exit 1
docker stop test

clean:
-docker image rm -f fmidev/smartmetserver
-docker image prune -f
rm -f debug.log

build-rhel10:
$(MAKE) clean-rhel10
docker build . --file Dockerfile.rhel10 --tag fmidev/smartmetserver-rhel10:latest --no-cache

test-rhel10:
docker rm -f test10 2>/dev/null || true
docker run --name test10 --rm -p 127.0.0.1:8080:8080 fmidev/smartmetserver-rhel10:latest &> debug10.log &
# Wait for the server to start
sleep 45s
# Check if the server is running
curl -f "http://localhost:8080/wms?request=getCapabilities&service=WMS" || exit 1
docker stop test10

clean-rhel10:
-docker image rm -f fmidev/smartmetserver-rhel10
-docker image prune -f
rm -f debug10.log
2 changes: 1 addition & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi
if [ "$1" = 'smartmetd' ]; then
id
whoami
LD_PRELOAD=libjemalloc.so.2 exec /usr/sbin/smartmetd
LD_PRELOAD=/usr/lib64/libjemalloc.so.2 exec /usr/sbin/smartmetd
fi

exec "$@"