Skip to content

Commit

Permalink
update .omero, some test failing
Browse files Browse the repository at this point in the history
  • Loading branch information
glyg committed Jan 24, 2024
1 parent 37a3655 commit be5209a
Show file tree
Hide file tree
Showing 31 changed files with 37 additions and 42 deletions.
5 changes: 3 additions & 2 deletions .omero/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ROOTPASS=omero
# Other configuration properties
POSTGRES_IMAGE=postgres
POSTGRES_VERSION=10
POSTGRES_VERSION=15
POSTGRES_PASSWORD=postgres
OMERO_SERVER_IMAGE=openmicroscopy/omero-server
OMERO_SERVER_VERSION=5
Expand All @@ -13,4 +13,5 @@ OMERO_WEB_VERSION=5
OMERO_WEB_PORT=

# srv-compose.yml related values
BUILD_IMAGE=adoptopenjdk:11-jdk-hotspot-bionic
BUILD_IMAGE=eclipse-temurin:11-jdk-jammy
OMERO_POLICY_BINARY_ACCESS=+read,+write,+image
Empty file modified .omero/app-build
100644 → 100755
Empty file.
Empty file modified .omero/app-config
100644 → 100755
Empty file.
Empty file modified .omero/app-docker
100644 → 100755
Empty file.
10 changes: 1 addition & 9 deletions .omero/cli-build
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,7 @@ cd $TARGET
GUESS=${PWD#*omero-cli-*}
PLUGIN=${PLUGIN:-$GUESS}

export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:/bin/java::")
export JAVA_LD_LIBRARY_PATH="$JAVA_HOME/lib/:$JAVA_HOME/lib/server"
export CONDA_BACKUP_JAVA_HOME=$JAVA_HOME
export CONDA_BACKUP_JAVA_LD_LIBRARY_PATH=$JAVA_LD_LIBRARY_PATH

source /tmp/miniconda/bin/activate
conda init
conda activate omero

export OMERO_DIST=${OMERO_DIST:-/opt/omero/server/OMERO.server}
omero $PLUGIN -h

python setup.py test -t test -i ${OMERO_DIST}/etc/ice.config -vs
Empty file modified .omero/cli-docker
100644 → 100755
Empty file.
5 changes: 5 additions & 0 deletions .omero/compose
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)

. ${dir}/utils
PROJECT=${PROJECT:-$(get_project_name)}
POLICY_BINARY_ACCESS=${POLICY_BINARY_ACCESS:-+read,+write,+image}
# Note: for backwards compatibility, we're not yet
# making use of COMPOSE_PROJECT_NAME

cd $dir

sed -i -e "/OMERO_POLICY_BINARY_ACCESS/d" .env
echo "OMERO_POLICY_BINARY_ACCESS="$POLICY_BINARY_ACCESS >> .env

exec docker compose -p ${PROJECT} "$@"
1 change: 1 addition & 0 deletions .omero/docker
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export TARGET=/$(basename $PWD)
export NOCLEAN=${NOCLEAN:-"false"}
export LOGS=${LOGS:-"false"}
export PLUGIN=${PLUGIN:-}
export POLICY_BINARY_ACCESS=${POLICY_BINARY_ACCESS:-+read,+write,+image}

if [ $# -eq 0 ]; then
echo "docker [stage [stage [stage]]]"
Expand Down
3 changes: 1 addition & 2 deletions .omero/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ services:
- CONFIG_omero_db_name=postgres
- CONFIG_omero_db_pass=${POSTGRES_PASSWORD}
- CONFIG_omero_upgrades_url=
- CONFIG_omero_policy_binary__access=${OMERO_POLICY_BINARY_ACCESS}
- CONFIG_Ice_IPv6=0
- CONFIG_omero_policy_binary__access=+read,+write,+image,+plate
- JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
ports:
- "${OMERO_SERVER_TCP}4063"
- "${OMERO_SERVER_SSL}4064"
Expand Down
Empty file modified .omero/download.sh
100644 → 100755
Empty file.
Empty file modified .omero/lib-build
100644 → 100755
Empty file.
Empty file modified .omero/lib-docker
100644 → 100755
Empty file.
Empty file modified .omero/lib-test
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions .omero/omeroserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG OMEROSERVER_BASE_IMAGE=openmicroscopy/omero-server:latest
FROM $OMEROSERVER_BASE_IMAGE

USER root
RUN yum install -y -q \
RUN dnf install -y -q \
git && \
rm -rf /var/cache/yum
dnf clean all
USER omero-server
4 changes: 2 additions & 2 deletions .omero/omeroweb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ ARG OMEROWEB_BASE_IMAGE=openmicroscopy/omero-web:latest
FROM $OMEROWEB_BASE_IMAGE

USER root
RUN yum install -y -q \
RUN dnf install -y -q \
java-11-openjdk \
git && \
rm -rf /var/cache/yum
dnf clean all
USER omero-web
6 changes: 3 additions & 3 deletions .omero/persist.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ function backup_volume {
volume_name=$1
backup_destination=$2
echo "Backup $volume_name to $backup_destination"
docker run --rm -v $volume_name:/data -v $backup_destination:/backup ubuntu tar -zcf /backup/$volume_name.tar /data
MSYS_NO_PATHCONV=1 docker run --rm -v $volume_name:/data -v $backup_destination:/backup ubuntu tar -zcf /backup/$volume_name.tar /data
}

function restore_volume {
volume_name=$1
backup_destination=$2
echo "Restore $volume_name from $backup_destination"
docker run --rm -v $volume_name:/data ubuntu find /data -mindepth 1 -delete
docker run --rm -v $volume_name:/data -v $backup_destination:/backup ubuntu tar -xf /backup/$volume_name.tar -C .
MSYS_NO_PATHCONV=1 docker run --rm -v $volume_name:/data ubuntu find /data -mindepth 1 -delete
MSYS_NO_PATHCONV=1 docker run --rm -v $volume_name:/data -v $backup_destination:/backup ubuntu tar -xf /backup/$volume_name.tar -C .
}

function main {
Expand Down
10 changes: 9 additions & 1 deletion .omero/py-check
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@ set -u
set -x

TARGET=${TARGET:-..}

git config --global --add safe.directory $TARGET

cd $TARGET
if [ -f .pre-commit-config.yaml ]; then
pre-commit run -a
else
flake8 -v .
fi
rst-lint README.md
# Check if there is an README.rst
if [ -f README.rst ]; then
rst-lint README.rst
else
rst-lint README.md
fi
Empty file modified .omero/py-common
100644 → 100755
Empty file.
16 changes: 2 additions & 14 deletions .omero/py-setup
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,9 @@ set -x
TARGET=${TARGET:-..}
PLUGIN=${PLUGIN:-}

export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:/bin/java::")
export JAVA_LD_LIBRARY_PATH="$JAVA_HOME/lib/:$JAVA_HOME/lib/server"
export CONDA_BACKUP_JAVA_HOME=$JAVA_HOME
export CONDA_BACKUP_JAVA_LD_LIBRARY_PATH=$JAVA_LD_LIBRARY_PATH
wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
sh Miniconda3-latest-Linux-x86_64.sh -b -p /tmp/miniconda
source /tmp/miniconda/bin/activate
conda init
conda create -n omero python=3.8
conda activate omero
conda install -c conda-forge zeroc-ice=3.6.5
conda install -c bioconda bftools

cd $TARGET
cd $(setup_dir)
pip install .
python setup.py sdist
pip install -U dist/*.tar.gz
python setup.py clean
rm -rf dist *egg-info src/*egg-info
13 changes: 7 additions & 6 deletions .omero/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
flake8<3.6.0
flake8
pyflakes
pep8-naming
pre-commit
pycodestyle<2.4.0
pycodestyle
restructuredtext_lint
pytest==3.3.2
attrs==19.1.0
pytest<5
attrs
restview
mox
# TODO: Apps only
pytest-django==3.1.2
pytest-runner==3.0.1
pytest-django
pytest-runner
Empty file modified .omero/scripts-build
100644 → 100755
Empty file.
Empty file modified .omero/scripts-copy
100644 → 100755
Empty file.
Empty file modified .omero/scripts-docker
100644 → 100755
Empty file.
Empty file modified .omero/srv-test
100644 → 100755
Empty file.
Empty file modified .omero/utils
100644 → 100755
Empty file.
Empty file modified .omero/wait-on-login
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified requirements.txt
100644 → 100755
Empty file.
Empty file modified setup.py
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion test/integration/test_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def test_pack_metadata_only(self, target_name, tmpdir):
args = self.args + ["pack", target, "--binaries", "none", "--simple",
str(tmpdir)]
with pytest.raises(ValueError):
self.cli.invoke(args, strict=True)
self.cli.invoke(args, strict=True)
self.delete_all()

@pytest.mark.parametrize('folder_name', TEST_FOLDERS)
Expand Down

0 comments on commit be5209a

Please sign in to comment.