AWS S3 Plugin Instructions Not Working

Hello all,

I am currently trying to compile the AWS S3 plugin as outlined in https://book.orthanc-server.com/plugins/object-storage.html#id1 .

However when I run the line cmake -DCMAKE_TOOLCHAIN_FILE=[vcpkg root]\scripts\buildsystems\vcpkg.cmake …/…/orthanc-object-storage/Aws I get an error saying that the source directory does not exist and then if I make the folder and re run the command, I get another error saying that the folder does not contain a CMakeLists.txt file.

Am I doing something wrong or is there something wrong with the instructions?

Thank you in advance for any help/advice!

George

[vcpkg root] must of course be replaced by the path to your vcpkg installation directory

Hi Alain,

Yes I have replaced that value, I just kept is as the original on this post for general reading.

George

Hello,

The “…/…/orthanc-object-storage/Aws” argument must be replaced by the folder that contains the following path of the source code package:
https://hg.orthanc-server.com/orthanc-object-storage/file/default/Aws

Type the following command to make sure that it is the case:

$ ls -l …/…/orthanc-object-storage/Aws/CMakeLists.txt

Sébastien-

This does not appear to work for me either. Not sure what NB means.

I am using Linux so the vcpkg and instructions do not appear to be relevant.

Hi David,

Here’s the definition for NB (used quite a lot in French)

Note that you may use vcpkg on Linux as well, we use it to build the Google and Azure plugins but it’s not necessary for AWS.

Here are build instructions extracted from our Docker builds. They should work on any Debian based OS:

prerequisites (for object-storage client side encryption)

export DEBIAN_FRONTEND=noninteractive &&
apt-get --assume-yes update &&
apt-get --assume-yes install libcrypto+±dev &&
apt-get clean &&
rm -rf /var/lib/apt/lists/*

mkdir /sources
cd /sources

hg clone https://hg.orthanc-server.com/orthanc-object-storage/ -r $ORTHANC_AWS_STORAGE_COMMIT_ID

(framework version used to build the cloud storage plugins)

hg clone https://hg.orthanc-server.com/orthanc/ -r “Orthanc-1.10.1”

mkdir -p /build/cloud-storage/aws
cd /build/cloud-storage/aws
cmake -DCMAKE_BUILD_TYPE:STRING=Release -DUSE_VCPKG_PACKAGES=OFF -DORTHANC_FRAMEWORK_SOURCE=path -DORTHANC_FRAMEWORK_ROOT=/sources/orthanc/OrthancFramework/Sources /sources/orthanc-object-storage/Aws/
make -j 4

Hope this helps,

Alain.

add-apt-repository universe
apt-get install mercurial

hg clone https://hg.orthanc-server.com/orthanc-object-storage/ -r $ORTHANC_AWS_STORAGE_COMMIT_ID
hg clone: option -r requires argument
hg clone [OPTION]… SOURCE [DEST]

Now I am stuck again

ARN??

Hi David,

The best place to use for reference is the orthanc-builder repo. Specifically you can find the build steps for the s3 plug-in here
https://github.com/orthanc-server/orthanc-builder/blob/master/docker/orthanc/Dockerfile#L271

This image uses a prebuilt image that has some prerequisites for building. They can be seen here
https://github.com/orthanc-server/orthanc-builder/blob/master/docker/orthanc/Dockerfile.builder-base

Hope that helps.

James

Thanks for the reply.

I am still having difficulty grasping this.

It seems that I would get much further if I could figure out exactly what the ARGS were, but then again it appears that the ARGS are specific for images which is what I thought I was building. It also seems to me that osimis and stone images are no longer supported. Is there a reference for these ARGS?

ARG ORTHANC_COMMIT_ID
ARG ORTHANC_GDCM_COMMIT_ID
ARG ORTHANC_PG_COMMIT_ID
ARG ORTHANC_MYSQL_COMMIT_ID
ARG ORTHANC_TRANSFERS_COMMIT_ID
ARG ORTHANC_DW_COMMIT_ID
ARG ORTHANC_WSI_COMMIT_ID
ARG ORTHANC_OWV_COMMIT_ID
ARG ORTHANC_AUTH_COMMIT_ID
ARG ORTHANC_PYTHON_COMMIT_ID
ARG ORTHANC_ODBC_COMMIT_ID
ARG ORTHANC_INDEXER_COMMIT_ID
ARG ORTHANC_NEURO_COMMIT_ID
ARG ORTHANC_TCIA_COMMIT_ID
ARG ORTHANC_STONE_VIEWER_COMMIT_ID
ARG ORTHANC_STONE_VIEWER_COMMIT_ID

I started just wanting to get this to work with s3 bucket persistent storage and now I am compiling code and just added Docker to the confusion.

This is all good stuff but where is the best place to start? Do I really want to be running this in a Docker container? Docker does add another level of complexity especially when it comes to databases and persistent storage.

Is Docker really the best choice for production? Is this about scaling? How many images are we attempting to pump through this server?

Any and all input would be appreciated. A bit frustrated but lots of good stuff here.

Hi David,

I would personally recommend using containers to run any production system. In fact I would NOT recommend running production systems without docker. Whilst containers present their own learning curve, the benefits of them, the pre-built orthanc and other systems, the freedom to decouple the host OS from the production systems etc, far outweigh any learning curve. Here is a great series on getting started with Docker https://itnext.io/docker-from-the-beginning-part-i-ae809b84f89f

Going back to your question - the following are the S3 build commands from the official docker container

RUN export DEBIAN_FRONTEND=noninteractive &&
apt-get --assume-yes update &&
apt-get --assume-yes install libcrypto+±dev &&
apt-get clean &&
rm -rf /var/lib/apt/lists/*

hg clone https://hg.orthanc-server.com/orthanc-object-storage/ -r 2.1.2

(framework version used to build the cloud storage plugins)

hg clone https://hg.orthanc-server.com/orthanc/ -r “Orthanc-1.10.1”

cmake -DCMAKE_BUILD_TYPE:STRING=Release -DUSE_VCPKG_PACKAGES=OFF -DORTHANC_FRAMEWORK_SOURCE=path
-DORTHANC_FRAMEWORK_ROOT=./orthanc/OrthancFramework/Sources ./orthanc-object-storage/Aws/
make -j 4

From memory, this also requires a few lib-boost libraries.

Once built, it will create a s3 plugin library - this needs to be copied the orthanc plugins directory to be loaded.

Note: I haven’t run this so it may require tweaking.

Hope this helps.

James

Hi David,

Totally agree with James, we would never use anything else than Docker in production. And, the osimis/orthanc images are still maintained (I do maintain them), the latest release was last month.

Indeed, you need to learn Docker but it’s far easier than learning to compile stuff.

HTH,

Alain