Skip to content

Commit

Permalink
Merge pull request #6200 from joshmoore/bin-omero
Browse files Browse the repository at this point in the history
Remove bin/omero
  • Loading branch information
joshmoore authored Jan 9, 2020
2 parents f694061 + 2b2fdd5 commit b8b3037
Show file tree
Hide file tree
Showing 31 changed files with 190 additions and 1,561 deletions.
34 changes: 28 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,41 @@ ARG RUN_IMAGE=openmicroscopy/omero-${COMPONENT}:5.6
FROM ${BUILD_IMAGE} as build
USER root
ARG DEBIAN_FRONTEND=noninteractive

# From omero-install: step01_ubuntu1804_ice_deps.sh
RUN apt-get update && \
apt-get install -y -q \
build-essential \
wget \
db5.3-util \
libbz2-dev \
libdb++-dev \
libdb-dev \
libexpat-dev \
libmcpp-dev \
libssl-dev \
mcpp \
zlib1g-dev \
&& cd /tmp \
&& wget -q https://github.com/ome/zeroc-ice-ubuntu1804/releases/download/0.3.0/ice-3.6.5-0.3.0-ubuntu1804-amd64.tar.gz \
&& tar xf ice-3.6.5-0.3.0-ubuntu1804-amd64.tar.gz \
&& rm ice-3.6.5-0.3.0-ubuntu1804-amd64.tar.gz \
&& mv ice-3.6.5-0.3.0 /opt \
&& echo /opt/ice-3.6.5-0.3.0/lib/x86_64-linux-gnu > /etc/ld.so.conf.d/ice-x86_64.conf \
&& ldconfig

RUN apt-get update \
&& apt-get install -y ant git gradle maven python3 python3-pip python3-venv \
zlib1g-dev python-pillow python-numpy python-sphinx \
libssl-dev libbz2-dev libmcpp-dev libdb++-dev libdb-dev \
zeroc-ice-all-dev
python-pillow python-numpy python-sphinx

ENV VIRTUAL_ENV=/opt/omero/server/venv3
ENV PATH=$VIRTUAL_ENV/bin/:$PATH
ENV PATH=/opt/ice-3.6.5-0.3.0/bin:$VIRTUAL_ENV/bin/:$PATH
RUN mkdir -p /opt/omero/server/ \
&& python3 -m venv $VIRTUAL_ENV
RUN python -m pip install --upgrade pip setuptools
RUN python -m pip install https://github.com/ome/zeroc-ice-ubuntu1804/releases/download/0.2.0/zeroc_ice-3.6.5-cp36-cp36m-linux_x86_64.whl
RUN python -m pip install flake8 future pytest
RUN python -m pip install 'omero-py>=5.6.0.dev10'
RUN id 1000 || useradd -u 1000 -ms /bin/bash build

# TODO: would be nice to not need to copy .git since it invalidates the build frequently and takes more time
Expand Down Expand Up @@ -77,8 +100,7 @@ RUN rm -rf /opt/omero/server/OMERO.server
COPY --chown=omero-server:omero-server --from=build /src/dist /opt/omero/server/OMERO.server
USER root
RUN yum install -y git
RUN /opt/omero/server/venv3/bin/pip install future
RUN sed -i 's/#!\/usr\/bin\/env python/#!\/opt\/omero\/server\/venv3\/bin\/python/' /opt/omero/server/OMERO.server/bin/omero

USER omero-server
WORKDIR /opt/omero/server/OMERO.server
ENV VIRTUAL_ENV=/opt/omero/server/venv3
Expand Down
20 changes: 5 additions & 15 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,7 @@ To get started using Eclipse, execute "ant build-dev" and import the top-level

<target name="release-zip" description="Zip the dist directory into ${product.name}-${omero.version}.zip">
<zip destfile="${omero.home}/target/${product.name}-${omero.version}.zip">
<zipfileset dir="${dist.dir}" prefix="${product.name}-${omero.version}"
excludes="bin/omero"/>
<zipfileset dir="${dist.dir}" prefix="${product.name}-${omero.version}"
includes="bin/omero"
filemode="755"/>
<zipfileset dir="${dist.dir}" prefix="${product.name}-${omero.version}"/>
</zip>
</target>

Expand Down Expand Up @@ -308,9 +304,8 @@ To get started using Eclipse, execute "ant build-dev" and import the top-level
<target name="release-clients" description="Zip the Python and Java zips">
<zip destfile="${omero.home}/target/OMERO.py-${omero.version}.zip">
<zipfileset dir="${dist.dir}" prefix="OMERO.py-${omero.version}"
includes="bin/**,etc/**,lib/python/**,lib/fallback/**,sql/**,share/web/**" excludes="bin/omero"/>
<zipfileset dir="${dist.dir}" prefix="OMERO.py-${omero.version}"
includes="bin/omero" filemode="755"/>
includes="bin/**,etc/**,lib/fallback/**,sql/**,share/web/**"/>
<zipfileset dir="${dist.dir}" prefix="OMERO.py-${omero.version}"/>
</zip>
<zip destfile="${omero.home}/target/OMERO.java-${omero.version}.zip">
<zipfileset dir="${dist.dir}/lib/client" prefix="OMERO.java-${omero.version}/libs" includes="**/*.jar"/>
Expand All @@ -320,11 +315,7 @@ To get started using Eclipse, execute "ant build-dev" and import the top-level

<target name="release-tar" description="Tar the dist directory into ${product-name}-${omero.version}.tar.bz2">
<tar destfile="${product.name}-${omero.version}.tar.bz2" compression="bzip2">
<zipfileset dir="${dist.dir}" prefix="${product.name}-${omero.version}"
excludes="bin/omero"/>
<zipfileset dir="${dist.dir}" prefix="${product.name}-${omero.version}"
includes="bin/omero"
filemode="755"/>
<zipfileset dir="${dist.dir}" prefix="${product.name}-${omero.version}"/>
</tar>
</target>

Expand Down Expand Up @@ -484,8 +475,7 @@ omero.version=${omero.version}
<macrodef name="ice-admin">
<element name="args" implicit="yes"/>
<sequential>
<exec executable="python" dir="${dist.dir}" failonerror="true">
<arg value="bin/omero"/>
<exec executable="omero" dir="${dist.dir}" failonerror="true">
<arg value="admin"/>
<arg value="ice"/>
<args/>
Expand Down
43 changes: 42 additions & 1 deletion components/antlib/resources/global.xml
Original file line number Diff line number Diff line change
Expand Up @@ -538,13 +538,54 @@
<sequential>
<exec executable="python" failonerror="@{failonerror}">
<env key="ICE_CONFIG" value="${env.ICE_CONFIG}"/>
<env key="PYTHONPATH" path="test:build/lib:${basedir}/../target/lib/python:${env.PYTHONPATH}"/>
<env key="PYTHONPATH" path="test:build/lib:${env.PYTHONPATH}"/>
<arg value="${basedir}/setup.py"/>
<args/>
</exec>
</sequential>
</macrodef>

<macrodef name="download">
<attribute name="pkg"/>
<attribute name="file"/>
<attribute name="expected"/>
<attribute name="where"/>
<sequential>
<mkdir dir="@{where}"/>
<mkdir dir="../target/build/lib"/>
<local name="url_input"/>
<local name="url_output"/>
<local name="dest"/>
<local name="calculated"/>
<local name="mismatch"/>
<property name="dest" value="@{where}/@{file}"/>
<property name="url_input" value="${versions.@{pkg}-url}"/>
<propertyregex property="url_output"
input="${url_input}"
regexp="PACKAGE"
replace="@{pkg}"
global="true"
casesensitive="true" />
<get dest="${dest}" usetimestamp="true">
<url url="${url_output}/@{file}"/>
</get>
<checksum file="${dest}" algorithm="MD5" fileext=".md5"/>
<loadfile property="calculated" srcFile="${dest}.md5"/>
<condition property="mismatch">
<and>
<isset property="versions.@{pkg}-md5"/><!-- TODO: remove others -->
<not>
<equals arg1="@{expected}" arg2="" trim="true"/>
</not>
<not>
<equals arg1="@{expected}" arg2="${calculated}" trim="true"/>
</not>
</and>
</condition>
<fail if="${mismatch}" message="@{file}: checksum error"/>
</sequential>
</macrodef>

<macrodef name="makeManifest">
<attribute name="property"/>
<sequential>
Expand Down
2 changes: 1 addition & 1 deletion components/tests/ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ robot plugin, e.g. for a local server:
```
cd ../
mv dist/robot_ice.config components/tests/ui/resources/
ICE_CONFIG=$(pwd)/components/tests/ui/resources/robot_ice.config dist/bin/omero --path components/tests/ui/plugins robot config > components/tests/ui/resources/config.txt
ICE_CONFIG=$(pwd)/components/tests/ui/resources/robot_ice.config omero --path components/tests/ui/plugins robot config > components/tests/ui/resources/config.txt
```

Note this command will create the Robot configuration file using the
Expand Down
2 changes: 1 addition & 1 deletion components/tests/ui/resources/robot.template
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ ${WEBCLIENT LOGIN URL} ${LOGIN URL}?url=%(QWEBPREFIX)s%(QSEP)swebclient%(QS
${USERS URL} ${WEBADMIN WELCOME URL}experimenters/
${GROUPS URL} ${WEBADMIN WELCOME URL}groups/

${COMMAND} bin/omero
${COMMAND} omero
80 changes: 40 additions & 40 deletions components/tests/ui/robot_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ FILE_ANNOTATION=${FILE_ANNOTATION:-robot_file_annotation.txt}
FILE_ANNOTATION2=${FILE_ANNOTATION2:-robot_file_annotation2.txt}

# Create robot user and group
bin/omero login root@$HOSTNAME:$PORT -w $ROOT_PASSWORD
bin/omero group add $GROUP_NAME --ignore-existing --perms $GROUP_PERMS
bin/omero group add $GROUP_NAME_2 --ignore-existing
bin/omero user add $USER_NAME $USER_NAME $USER_NAME $GROUP_NAME $GROUP_NAME_2 --ignore-existing -P $USER_PASSWORD
bin/omero user joingroup --name $USER_NAME --group-name $GROUP_NAME --as-owner
bin/omero logout
omero login root@$HOSTNAME:$PORT -w $ROOT_PASSWORD
omero group add $GROUP_NAME --ignore-existing --perms $GROUP_PERMS
omero group add $GROUP_NAME_2 --ignore-existing
omero user add $USER_NAME $USER_NAME $USER_NAME $GROUP_NAME $GROUP_NAME_2 --ignore-existing -P $USER_PASSWORD
omero user joingroup --name $USER_NAME --group-name $GROUP_NAME --as-owner
omero logout

# Create fake files
touch $IMAGE_NAME
Expand All @@ -58,104 +58,104 @@ echo "Robot test file annotations" > "$FILE_ANNOTATION"
echo "Another test file annotation" > "$FILE_ANNOTATION2"

# Create robot setup
bin/omero login $USER_NAME@$HOSTNAME:$PORT -w $USER_PASSWORD
omero login $USER_NAME@$HOSTNAME:$PORT -w $USER_PASSWORD
# Parse the sessions file to get session key
key=$(bin/omero sessions key)
key=$(omero sessions key)
echo "Session key: $key"
nProjects=1
nDatasets=1
nImages=10
echo "Creating projects and datasets"
for (( i=1; i<=$nProjects; i++ ))
do
project=$(bin/omero obj new Project name='Project '$i)
project=$(omero obj new Project name='Project '$i)
for (( j=1; j<=$nDatasets; j++ ))
do
dataset=$(bin/omero obj new Dataset name='Dataset '$i-$j)
bin/omero obj new ProjectDatasetLink parent=$project child=$dataset
dataset=$(omero obj new Dataset name='Dataset '$i-$j)
omero obj new ProjectDatasetLink parent=$project child=$dataset
echo "Importing images into dataset"
for (( k=1; k<=$nImages; k++ ))
do
bin/omero import -d $dataset $IMAGE_NAME --debug ERROR > show_import.log 2>&1
omero import -d $dataset $IMAGE_NAME --debug ERROR > show_import.log 2>&1
imageid=$(sed -n -e 's/^Image://p' show_import.log)
bin/omero obj update Image:$imageid name=test_view$k
omero obj update Image:$imageid name=test_view$k
done
done
done

# Create Dataset with images for deleting
delDs=$(bin/omero obj new Dataset name='Delete')
delDs=$(omero obj new Dataset name='Delete')
for (( k=1; k<=10; k++ ))
do
bin/omero import -d $delDs $TINY_IMAGE_NAME --debug ERROR
omero import -d $delDs $TINY_IMAGE_NAME --debug ERROR
done

# Create Dataset with MIF images
mifDs=$(bin/omero obj new Dataset name='MIF Images')
mifDs=$(omero obj new Dataset name='MIF Images')
for (( k=1; k<=2; k++ ))
do
bin/omero import -d $mifDs $MIF_IMAGE_NAME --debug ERROR
omero import -d $mifDs $MIF_IMAGE_NAME --debug ERROR
done

# Create Dataset with multi channel images
mcDs=$(bin/omero obj new Dataset name='MultiChannel Images')
mcDs=$(omero obj new Dataset name='MultiChannel Images')
for (( k=1; k<=2; k++ ))
do
bin/omero import -d $mcDs $MULTI_C_IMAGE_NAME --debug ERROR
omero import -d $mcDs $MULTI_C_IMAGE_NAME --debug ERROR
done

# Create Dataset with Big Image
bigDs=$(bin/omero obj new Dataset name='Big Images')
bin/omero import -d $bigDs $BIG_IMAGE_NAME --debug ERROR
bigDs=$(omero obj new Dataset name='Big Images')
omero import -d $bigDs $BIG_IMAGE_NAME --debug ERROR

# Import Plate and rename
bin/omero import $PLATE_NAME --debug ERROR > plate_import.log 2>&1
omero import $PLATE_NAME --debug ERROR > plate_import.log 2>&1
plateid=$(sed -n -e 's/^Plate://p' plate_import.log)
bin/omero obj update Plate:$plateid name=spwTests
omero obj update Plate:$plateid name=spwTests
# Use populate_metadata to upload and attach bulk annotation csv
# We use testtables to only try populate if tables are working
export OMERO_DEV_PLUGINS=1 # required to enable 'metadata' CLI
bin/omero metadata testtables && bin/omero metadata populate Plate:$plateid --file $BULK_ANNOTATION_CSV
omero metadata testtables && omero metadata populate Plate:$plateid --file $BULK_ANNOTATION_CSV

# Run script to populate WellSamples with posX and posY values
PYTHONPATH=./lib/python python $WELLSCRIPT $HOSTNAME $PORT $key $plateid
python $WELLSCRIPT $HOSTNAME $PORT $key $plateid

# Import Tiny Plate (single acquisition & well) and rename
bin/omero import $TINY_PLATE_NAME --debug ERROR > show_import.log 2>&1
omero import $TINY_PLATE_NAME --debug ERROR > show_import.log 2>&1
plateid=$(sed -n -e 's/^Plate://p' show_import.log)
bin/omero obj update Plate:$plateid name=tinyPlate
omero obj update Plate:$plateid name=tinyPlate
# Import Image into Project/Dataset and rename for test
showP=$(bin/omero obj new Project name='showProject')
showD=$(bin/omero obj new Dataset name='showDataset')
bin/omero obj new ProjectDatasetLink parent=$showP child=$showD
showP=$(omero obj new Project name='showProject')
showD=$(omero obj new Dataset name='showDataset')
omero obj new ProjectDatasetLink parent=$showP child=$showD
for (( k=1; k<=2; k++ ))
do
bin/omero import -d $showD $IMAGE_NAME --debug ERROR > show_import.log 2>&1
omero import -d $showD $IMAGE_NAME --debug ERROR > show_import.log 2>&1
imageid=$(sed -n -e 's/^Image://p' show_import.log)
bin/omero obj update Image:$imageid name=testShowImage$k
omero obj update Image:$imageid name=testShowImage$k
done

# Create Screen with empty plates for Create Scenario
scrDs=$(bin/omero obj new Screen name='CreateScenario')
scrDs=$(omero obj new Screen name='CreateScenario')
for (( k=1; k<=6; k++ ))
do
bin/omero import -r $scrDs $TINY_PLATE_NAME --debug ERROR
omero import -r $scrDs $TINY_PLATE_NAME --debug ERROR
done

# Create Orphaned Images for Create Scenario
for (( k=1; k<=10; k++ ))
do
bin/omero import $TINY_IMAGE_NAME --debug ERROR
omero import $TINY_IMAGE_NAME --debug ERROR
done

# Upload files and create FileAnnotations
ofile=$(bin/omero upload $FILE_ANNOTATION)
bin/omero obj new FileAnnotation file=$ofile
ofile2=$(bin/omero upload $FILE_ANNOTATION2)
bin/omero obj new FileAnnotation file=$ofile2
ofile=$(omero upload $FILE_ANNOTATION)
omero obj new FileAnnotation file=$ofile
ofile2=$(omero upload $FILE_ANNOTATION2)
omero obj new FileAnnotation file=$ofile2

# Logout
bin/omero logout
omero logout

# Create ice.config file
echo "omero.host=$HOSTNAME" > "$CONFIG_FILENAME"
Expand Down
2 changes: 1 addition & 1 deletion components/tools/OmeroFS/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<target name="integration" depends="python-integration" unless="env.NOPYTHON"/>

<target name="tools-init" depends="python-download" unless="env.NOPYTHON"/>
<target name="tools-init" unless="env.NOPYTHON"/>

<target name="tools-build" depends="tools-init" description="Creates all artifacts for tools/target" unless="env.NOPYTHON"/>

Expand Down
Loading

0 comments on commit b8b3037

Please sign in to comment.