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

OZ-718: Combine SENAITE docker images in one repo #19

Merged
merged 8 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 6 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
15 changes: 14 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,29 @@ name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]

jobs:
docker-release:
build-publish:
uses: mekomsolutions/shared-github-workflow/.github/workflows/docker-build-publish.yml@main
with:
context: senaite-without-sso/
download-artifacts: false
image-name: "senaite"
image-version: "dev"
secrets:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_REGISTRY_USERNAME }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_REGISTRY_PASSWORD }}
build-publish-sso:
uses: mekomsolutions/shared-github-workflow/.github/workflows/docker-build-publish.yml@main
with:
context: senaite-with-sso/
download-artifacts: false
VaishSiddharth marked this conversation as resolved.
Show resolved Hide resolved
image-name: "senaite-sso"
image-version: "dev"
secrets:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_REGISTRY_USERNAME }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_REGISTRY_PASSWORD }}
File renamed without changes.
44 changes: 44 additions & 0 deletions senaite-with-sso/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM mekomsolutions/senaite

# Copy Buildout
COPY requirements.txt buildout.cfg develop.cfg $SENAITE_INSTANCE_HOME/

# Copy the build dependencies and startup scripts
COPY build_deps.txt run_deps.txt /

# Install moreutils and gettext
RUN apt-get update \
&& apt-get install -y --no-install-recommends moreutils gettext \
&& rm -rf /var/lib/apt/lists/*

# Note: we concatenate all commands to avoid multiple layer generation and reduce the image size
RUN apt-get update \
# Install system packages
&& apt-get install -y --no-install-recommends $(grep -vE "^\s*#" /build_deps.txt | tr "\n" " ") \
&& apt-get install -y --no-install-recommends $(grep -vE "^\s*#" /run_deps.txt | tr "\n" " ") \
&& git clone https://github.com/mekomsolutions/ftw.oidcauth.git $SENAITE_INSTANCE_HOME/src/ftw.oidcauth \
&& cd $SENAITE_INSTANCE_HOME/src/ftw.oidcauth && git checkout custom \
# Buildout
&& cd $SENAITE_INSTANCE_HOME \
&& pip install -r requirements.txt \
&& buildout \
&& ln -s $SENAITE_FILESTORAGE/ var/filestorage \
&& ln -s $SENAITE_BLOBSTORAGE/ var/blobstorage \
&& chown -R senaite:senaite $SENAITE_HOME $SENAITE_DATA \
# Cleanup
&& apt-get purge -y --auto-remove $(grep -vE "^\s*#" /build_deps.txt | tr "\n" " ") \
&& rm -rf /$SENAITE_HOME/buildout-cache \
&& rm -rf /var/lib/apt/lists/*
COPY docker-initialize.py docker-entrypoint.sh /

# Change working directory
WORKDIR $SENAITE_INSTANCE_HOME

# Mount external volume
VOLUME /data

# Expose instance port
EXPOSE 8080

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["start"]
18 changes: 18 additions & 0 deletions senaite-with-sso/build_deps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
dpkg-dev
gcc
g++
libpq-dev
python-dev
libbz2-dev
libc6-dev
libffi-dev
libjpeg62-turbo-dev
libopenjp2-7-dev
libpcre3-dev
libssl-dev
libtiff5-dev
libxml2-dev
libxslt1-dev
wget
zlib1g-dev
git
101 changes: 101 additions & 0 deletions senaite-with-sso/buildout.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
[buildout]
index = https://pypi.python.org/simple/
extends =
buildout-base.cfg
extensions = mr.developer

var-dir=/data
user=admin:admin

effective-user = senaite
buildout-user = senaite

eggs-directory=eggs
download-cache=../buildout-cache/downloads

parts +=
zeo
plonesite
console_scripts
cron-pack

eggs +=
senaite.lims
ftw.oidcauth
plone.initializer
senaite.indexer
senaite.monkeypatches
RelStorage
pg8000

############################################
# Development Eggs
# ----------------
# You can use paster to create "development eggs" to
# develop new products/themes. Put these in the src/
# directory.
# You will also need to add the egg names in the
# eggs section above, and may also need to add them
# to the zcml section.
#
# Provide the *paths* to the eggs you are developing here:
develop =
src/plone.initializer
src/ftw.oidcauth
src/senaite.indexer
src/senaite.monkeypatches

[client1]
recipe =

[zeo]
<= zeoserver_base
recipe = plone.recipe.zeoserver
zeo-address = 8080
pack-days = 0
pack-keep-old = false

[cron-pack]
recipe = z3c.recipe.usercrontab
times = 0 0 * * *
command = ${buildout:bin-directory}/zeopack

[instance]
# taken from https://github.com/plone/plone.docker/blob/master/5.2/5.2.5/python2/buildout.cfg
event-log-handler = StreamHandler
event-log-args = (sys.stderr,)
access-log-handler = StreamHandler
access-log-args = (sys.stdout,)
z2-log-level = ERROR
event-log-max-size = 5 MB
event-log-old-files = 5
access-log-max-size = 20 MB
access-log-old-files = 10

[console_scripts]
recipe = zc.recipe.egg:scripts
eggs = senaite.core

[plonesite]
recipe = collective.recipe.plonesite
instance = instance
site-id = senaite
profiles-initial = Products.CMFPlone:dependencies
profiles =
senaite.lims:default
plone.initializer:default
ftw.oidcauth:default
senaite.indexer:default
upgrade-portal = False
upgrade-all-profiles = False
enabled = False

[versions]
setuptools =
zc.buildout =
senaite.core = 2.5.0
senaite.lims = 2.5.0
RelStorage = 2.1.1
pg8000 = 1.12.5
perfmetrics = 3.3.0
et-xmlfile = 1.1.0
165 changes: 165 additions & 0 deletions senaite-with-sso/develop.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
#################################################################
#
# Development Configuration
# =========================
#
# This is a buildout configuration that sets up a development
# environment for Plone. It extends buildout.cfg.
#
# To use this configuration, run buildout via:
#
# bin/buildout -c develop.cfg
#
# This specifies develop.cfg as buildout's configuration file. This configuration
# file extends buildout.cfg, so that all the options from that file are
# automatically included.
#
# Included in the development configuration
#
# Common development tools:
#
# * mr.bob, a Python package-skeleton generator. With bobtemplates.plone
# it has supportfor common Plone development packages like content-type
# and theme packages.
#
# * mr.developer, a tool that automatically checks out source for
# add ons from a versioning system, then adds them to your
# development package list.
#
# * testrunner, which provides a command-line option to run
# test suites.
#
# * Diazo command-line tools: diazocompile and diazorun. Useful
# for debugging and understanding Diazo and plone.app.theming.
# See http://docs.diazo.org/en/latest/compiler.html
#
# * collective.checkdocs adds new distutils commands checkdocs and
# showdocs to validate restructured text in long_description
# field of Python eggs.
#
# * zest.releaser, a kit for managing the release cycle for Python
# packages. See https://pypi.python.org/pypi/zest.releaser.
#
# Common Customizations
# =====================
#
# Add packages to the sources managed by mr.developer by adding them to the
# [sources] section below.
#
# Add packages to the test suite by adding them to the "test-packages" option
# in the [buildout] section below.


############################################
# Sources
# -------
# Specify packages under development here.
#
# See http://pypi.python.org/pypi/mr.developer for mr.developer source specifications.
# <name> = <kind> [key=value] <url> [path] [key=value]
# kind = The kind of repository. Currently supported are one of svn (>= 1.5), hg, git, cvs or fs.
#
[sources]
# Examples: to check out plonetheme.sunburst from Plone's svn, use:
# plonetheme.sunburst = svn https://svn.plone.org/svn/plone/plonetheme.sunburst/trunk
#
# To use a python package that is being developed in your src subdirectory, use:
# myproduct.betterplone = fs myproduct.betterplone


[buildout]

############################################
# Test Packages
# ----------
# Specify a list of packages that you wish to explicity include in your test suite.
# Base eggs are automatically included
#
test-packages =
# plonetheme.sunburst


############################################
# Debug Mode
# ----------
# Most development work is done with Zope/Plone started
# in foreground mode (bin/plonectl fg), which automatically
# turns on debug mode and causes Zope/Plone to stop on
# package loading errors.
#
# Note that debug mode makes Plone run *very* slowly due to
# extra filesystem checks and granular transmission of browser resources.
#
# If you're developing Plone add-ons, you should want to see
# deprecation warnings that let you know if you're using outmoded
# methods or modules.
deprecation-warnings = on
#
# Turning on verbose security may help diagnose security bugs.
# You'll also need to disable the intercepting of "unauthorized"
# errors in the error_log via the ZMI.
verbose-security = off


############################################
# Less Commonly Changed Options
# -----------------------------
# The remainder of the buildout mainly sets up the development
# environment based on the settings above.

# we're extending buildout.cfg
extends =
buildout.cfg

extensions +=
mr.developer


# mr.developer settings:
always-checkout = force
sources = sources
auto-checkout = *


[test]
recipe = collective.xmltestreport
defaults = ['--auto-color', '--auto-progress', '--ignore_dir=.git', '--ignore_dir=bower_components', '--ignore_dir=node_modules']
eggs =
${buildout:eggs}
${buildout:test-packages}


# Add diazo compile/run tools to bin; useful for debugging understanding
# diazo. See http://docs.diazo.org/en/latest/compiler.html
[diazotools]
recipe = zc.recipe.egg
eggs = diazo


[checkdocs]
# installs collective.checkdocs from pypi [https://github.com/collective/collective.checkdocs]
recipe = zc.recipe.egg
eggs =
collective.checkdocs


# [mrbob]
# recipe = zc.recipe.egg
# eggs =
# mr.bob


[releaser]
# installs zest.releaser, po compiler
recipe = zc.recipe.egg
eggs =
zest.releaser
zest.pocompile

[i18ndude]
recipe = zc.recipe.egg
eggs = i18ndude

[plonecli]
recipe = zc.recipe.egg
eggs = plonecli
Loading
Loading