This repository was archived by the owner on Jan 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Docker2 #121
Open
mingrutar
wants to merge
8
commits into
master
Choose a base branch
from
docker2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Docker2 #121
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c44050e
added --vid_mapping_file and --version option
fd47f05
remove white spaces
763a373
refactory
937299f
Merge branch 'master' into docker1
mingrutar ff39031
addressed review issues
7063c4c
Docker source for GenomicsDB builder
e015586
more readme
b5a8bf5
add missed files
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # no build | ||
| /build_src/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # The MIT License (MIT) | ||
| # Copyright (c) 2016-2017 Intel Corporation | ||
| # | ||
| # Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
| # this software and associated documentation files (the "Software"), to deal in | ||
| # the Software without restriction, including without limitation the rights to | ||
| # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
| # the Software, and to permit persons to whom the Software is furnished to do so, | ||
| # subject to the following conditions: | ||
| # | ||
| # The above copyright notice and this permission notice shall be included in all | ||
| # copies or substantial portions of the Software. | ||
| # | ||
| # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
| # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
| # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
| # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| # | ||
| # The code utilized some features of RedHat pre-built container | ||
|
|
||
| FROM centos:7 | ||
|
|
||
| LABEL vendor="Intel Inc." name="GenomicsDB Builder" version="1.0" description="Build GenomicsDB" | ||
|
|
||
| RUN yum install -y --setopt=tsflags=nodocs centos-release-scl && \ | ||
| yum-config-manager --enable rhel-server-rhscl-7-rpms && \ | ||
| yum install -y devtoolset-4 && \ | ||
| yum install -y --setopt=tsflags=nodocs epel-release && \ | ||
| yum repolist && \ | ||
| yum install -y --setopt=tsflags=nodocs cmake git.x86_64 libcsv libcsv-devel mpich-devel openssl-devel zlib-devel unzip.x86_64 && \ | ||
| yum install -y python34.x86_64 && \ | ||
| yum clean all | ||
|
|
||
| ENV BASH_ENV=/etc/profile.d/cont-env.sh PATH=$PATH:/usr/lib64/mpich/bin HOME=/home/default | ||
|
|
||
| WORKDIR /home/default | ||
|
|
||
| ADD ./usr /usr | ||
| ADD ./etc /etc | ||
| ADD ./root /root | ||
|
|
||
| ENTRYPOINT ["/usr/bin/container-entrypoint"] | ||
| CMD ["build_genomicsdb"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| ### GenomicsDB Building Docker | ||
|
|
||
| The centos-build is the source code for building a GenomicsDB building environment Docker image. The details about GenomicsDB building environment can be found at [GenomicsDB Wiki]( https://github.com/Intel-HLS/GenomicsDB/wiki/Compiling-GenomicsDB#building.) | ||
|
|
||
| To create a GenomicsDB building environment Docker image, run the following command: | ||
|
|
||
| <code>docker build -t name_of_the_builder_image --no-cache .</code> | ||
|
|
||
| Once the image is created. You can build the latest GenomicsDB executables by running: | ||
|
|
||
| <code>docker run -it -v /path/2/output/:/output/ [-e GDB_BRANCH=branch_name_default_is_master] name_of_the_builder_image</code> | ||
|
|
||
| In this case, the docker container builds GenomicsDB with the following options: | ||
|
|
||
| * CMAKE_BUILD_TYPE=Release | ||
| * DO_PROFILING=False | ||
| * DISABLE_OPENMP=True | ||
| * BUILD_JAVA=False | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why disable OpenMP and Java? |
||
| * DO_PROFILING=False | ||
| * CMAKE_INSTALL_PREFIX=/output/ | ||
| * PROTOBUF_LIBRARY=dont_worry_the_docker_manage_it | ||
|
|
||
| You can pass GenomicsDB building options via docker run command arguments. The docker will pass your arguments to cmake. Since the docker builds protobuf library internally, you just ignore the PROTOBUF_LIBRARY option. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| source /usr/share/cont-lib/cont-env.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| source /usr/share/cont-lib/cont-env.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| #! /bin/bash | ||
| # The MIT License (MIT) | ||
| # Copyright (c) 2017 Intel Corporation | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2016-2017 |
||
| # | ||
| # Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
| # this software and associated documentation files (the "Software"), to deal in | ||
| # the Software without restriction, including without limitation the rights to | ||
| # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
| # the Software, and to permit persons to whom the Software is furnished to do so, | ||
| # subject to the following conditions: | ||
| # | ||
| # The above copyright notice and this permission notice shall be included in all | ||
| # copies or substantial portions of the Software. | ||
| # | ||
| # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
| # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
| # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
| # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
|
||
| if [ ! -d /output ]; then | ||
| echo 'can not find /output/ exit...' | ||
| return 2 | ||
| fi | ||
| export BUILD_ROOT=${HOME}/build_src | ||
| export PROTOBUF_LIBRARY=$BUILD_ROOT/protobuf_build | ||
| echo "build_home=$build_home, PROTOBUF_LIBRARY=$PROTOBUF_LIBRARY, GenomicsDB_HOME=$GenomicsDB_HOME" | ||
|
|
||
| protobuf_to_dir=/output | ||
| genomicsdb_to_dir=/output | ||
|
|
||
| # make protobuf | ||
| build_proto_buf() { | ||
| echo "+++ Building protobuf at ${PROTOBUF_LIBRARY}..." | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the message is wrong. you're not building protobuf under $BUILD_ROOT/protobuf_build, you're building it under /output
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you did not use PROTOBUF_LIBRARY actually in the cmake |
||
| mkdir -p /output/protobuf | ||
| mkdir -p ${PROTOBUF_LIBRARY} && pushd ${PROTOBUF_LIBRARY} >/dev/null 2>&1 | ||
| git clone https://github.com/google/protobuf.git | ||
| cd protobuf | ||
| git checkout 3.0.x | ||
| ./autogen.sh | ||
| ./configure --prefix=$protobuf_to_dir --with-pic | ||
| if [ -f ./Makefile ]; then | ||
| make && make install | ||
| basename $(ls $protobuf_to_dir/bin/protoc) | ||
| find $protobuf_to_dir/lib/ -name 'libproto*' -type f -exec basename {} \; | ||
| echo "--- Done building protobuf" | ||
| popd >/dev/null 2>&1 | ||
| return 0 | ||
| else | ||
| popd >/dev/null 2>&1 | ||
| echo "ERROR: build_proto_buf not find Makefile" | ||
| return -1 | ||
| fi | ||
| } | ||
|
|
||
| # make genomicsdb | ||
| build_gdb() { | ||
| echo | ||
| echo "+++ Building GenomicsDB at ${GenomicsDB_HOME}..." | ||
| git clone --recursive https://github.com/Intel-HLS/GenomicsDB.git | ||
| ws=GenomicsDB/build | ||
| mkdir -p $ws && pushd $ws >/dev/null 2>&1 | ||
| branch=${GDB_BRANCH:=master} | ||
| git checkout $branch | ||
| git branch | ||
| if [ $# -gt 0 ]; then | ||
| cmake --warn-uninitialized --debug-output .. -DCMAKE_INSTALL_PREFIX=$genomicsdb_to_dir -DPROTOBUF_LIBRARY=$protobuf_to_dir $@ | ||
| else | ||
| cmake --warn-uninitialized --debug-output .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$genomicsdb_to_dir -DDO_PROFILING=False -DPROTOBUF_LIBRARY=$protobuf_to_dir -DDISABLE_OPENMP=True -DBUILD_JAVA=False -DDO_PROFILING=False | ||
| fi | ||
|
|
||
| if [ -f ./Makefile ]; then | ||
| make && make install | ||
| echo "INFO: Successfully built GenomicsDB... run test" | ||
| ../tests/run.py $PWD $genomicsdb_to_dir | ||
| popd >/dev/null 2>&1 | ||
| return 0 | ||
| else | ||
| echo "ERROR: build_gdb not find Makefile" | ||
| popd >/dev/null 2>&1 | ||
| return -1 | ||
| fi | ||
| } | ||
|
|
||
| #source /opt/rh/devtoolset-4/enable | ||
| gcc --version | ||
|
|
||
| mkdir -p ${BUILD_ROOT} && pushd ${BUILD_ROOT} >/dev/null 2>&1 | ||
| build_proto_buf | ||
| retst=$? | ||
| if [ $retst -eq 0 ]; then | ||
| build_gdb $@ | ||
| retst=$? | ||
| rsync -az $genomicsdb_to_dir /usr | ||
| fi | ||
| [[ $retst -eq 0 ]] && echo "DONE: built GenomicsDB" || echo "FAIL: cannot build GenomicsDB" | ||
| popd >/dev/null 2>&1 | ||
| return $retst | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/bin/bash | ||
|
|
||
| . /usr/share/cont-lib/cont-lib.sh | ||
|
|
||
| cont_debug "command: $*" | ||
|
|
||
| __cont_source_scripts "/usr/share/cont-entry" | ||
|
|
||
| test -z "$*" && set -- bash | ||
| exec "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #!/bin/bash | ||
|
|
||
| # TODO: support API for executable help scripts | ||
| cat /usr/share/cont-docs/*.txt 2>/dev/null | ||
|
|
||
|
|
20 changes: 20 additions & 0 deletions
20
docker/genomicsdb_builder/usr/share/cont-docs/70-general.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| General container help | ||
| ---------------------- | ||
|
|
||
| Run `docker run THIS_IMAGE container-usage` to get this help. | ||
|
|
||
| Run `docker run -ti THIS_IMAGE bash` to obtain interactive shell. | ||
|
|
||
| Run `docker exec -ti CONTAINERID container-entrypoint` to access already running container. | ||
|
|
||
| In order to get the container ID after running the image, pass `--cidfile=` | ||
| option to the `docker run` command. That will instruct Docker to write | ||
| a file with the container ID. | ||
|
|
||
| You may try `-e CONT_DEBUG=VAL` with VAL up to 3 to get more verbose debugging | ||
| info. | ||
|
|
||
|
|
||
| Report bugs to <http://bugzilla.redhat.com>. | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Files '*.txt' are automatically read and added to 'container-usage' output. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| source /usr/share/cont-lib/cont-env.sh |
3 changes: 3 additions & 0 deletions
3
docker/genomicsdb_builder/usr/share/cont-layer/common/env/enabledevtoolset-4.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/bash | ||
| # M:R: this file was part of Red Hat samples | ||
| source scl_source enable devtoolset-4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| All '*.sh' files in this directory will be automatically sourced together with | ||
| cont-lib.sh script. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| . /usr/share/cont-lib/cont-lib.sh | ||
|
|
||
| cont_debug "changing environment variables" | ||
|
|
||
| cont_source_hooks env common | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| __cont_source_scripts() | ||
| { | ||
| local i | ||
| local dir="$1" | ||
| for i in "$dir"/*.sh; do | ||
| if test -r "$i"; then | ||
| . "$i" | ||
| fi | ||
| done | ||
| } | ||
|
|
||
|
|
||
| # CONT_SOURCE_HOOKS HOOKDIR [PROJECT] | ||
| # ----------------------------------- | ||
| # Source '*.sh' files from the following directories (in this order): | ||
| # a. /usr/share/cont-layer/PROJECT/HOOK/ | ||
| # b. /usr/share/cont-volume/PROJECT/HOOK/ | ||
| # | ||
| # The PROJECT argument is optional because it may be set globally by | ||
| # $CONT_PROJECT environment variable. The need for PROJECT argument is | ||
| # basically to push people to install script into theirs own directories, | ||
| # which will allow easier multi-project containers maintenance. | ||
| cont_source_hooks() | ||
| { | ||
| local i dir | ||
| local hook="$1" | ||
| local project="$CONT_PROJECT" | ||
| local dir | ||
|
|
||
| test -z "$hook" && return | ||
| test -n "$2" && project="$2" | ||
|
|
||
| for dir in /usr/share/cont-layer /usr/share/cont-volume; do | ||
| dir="$dir/$project/$hook" | ||
| cont_debug2 "loading scripts from $dir" | ||
| __cont_source_scripts "$dir" | ||
| done | ||
| } | ||
|
|
||
| __cont_msg() | ||
| { | ||
| echo "$*" >&2 | ||
| } | ||
|
|
||
|
|
||
| __cont_dbg() | ||
| { | ||
| test -z "$CONT_DEBUG" && CONT_DEBUG=0 | ||
| test "$CONT_DEBUG" -lt "$1" && return | ||
| local lvl="$1" | ||
| shift | ||
| __cont_msg "debug_$lvl: $*" | ||
| } | ||
|
|
||
|
|
||
| cont_warn() { __cont_msg "warn: $*" ; } | ||
| cont_error() { __cont_msg "error: $*"; } | ||
| cont_debug() { __cont_dbg 1 "$*" ; } | ||
| cont_debug2() { __cont_dbg 2 "$*" ; } | ||
| cont_debug3() { __cont_dbg 3 "$*" ; } | ||
|
|
||
|
|
||
| __cont_encode_env() | ||
| { | ||
| local i | ||
| for i in $1 | ||
| do | ||
| eval local val="\$$i" | ||
| printf ": \${%s=%q}\n" "$i" "$val" | ||
| done | ||
| } | ||
|
|
||
|
|
||
| # CONT_STORE_ENV VARIABLES FILENAME | ||
| # --------------------------------- | ||
| # Create source-able script conditionally setting specified VARIABLES by | ||
| # inheritting the values from current environment; Create the file on path | ||
| # FILENAME. Already existing variables will not be changed by sourcing the | ||
| # resulting script. The argument VARIABLES expects list of space separated | ||
| # variable names. | ||
| # | ||
| # Usage: | ||
| # $ my_var=my_value | ||
| # $ my_var2="my value2" | ||
| # $ cont_store_env "my_var my_var2" ~/.my-environment | ||
| # $ cat ~/.my-environment | ||
| # : ${my_var=my_value} | ||
| # : ${my_var2=my\ value2} | ||
| cont_store_env() | ||
| { | ||
| cont_debug "creating env file '$2'" | ||
| __cont_encode_env "$1" > "$2" \ | ||
| || cont_warn "can't store environment $1 into $2 file" | ||
| } | ||
|
|
||
|
|
||
| __cont_source_scripts "/usr/share/cont-lib/autoload" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intel Corporation