This repository contains tools for the running troubleshooting of a Docker-containerized iRODS server.
- General Setup
- Simplified Setup
- Debugging
gdb
rr
valgrind
- (
cppcheck
, clang static analyzer, ... ?)
- Create custom paths.
$ git clone https://github.com/irods/irods_development_environment /full/path/to/irods_development_environment_repository_clone
$ git clone --recursive https://github.com/irods/irods /full/path/to/irods_repository_clone
$ git clone https://github.com/irods/irods_client_icommands /full/path/to/icommands_repository_clone
- Make 3 directories on host machine for docker volume mounts:
$ mkdir /full/path/to/irods_build_output_dir
$ mkdir /full/path/to/icommands_build_output_dir
$ mkdir /full/path/to/packages_output_dir
Note: It may be useful to keep separate build directories across OS flavors in order to ensure correctness of builds.
- Build the Docker images:
$ cd /full/path/to/irods_development_environment_repository_clone
$ docker build -f Dockerfile.irods_core_builder.centos7 -t irods-core-builder-centos7 .
$ docker build -f Dockerfile.irods_core_builder.ubuntu16 -t irods-core-builder-ubuntu16 .
$ docker build -f Dockerfile.irods_core_builder.ubuntu18 -t irods-core-builder-ubuntu18 .
$ docker build -f Dockerfile.irods_runner.centos7 -t irods-runner-centos7 .
$ docker build -f Dockerfile.irods_runner.ubuntu16 -t irods-runner-ubuntu16 .
$ docker build -f Dockerfile.irods_runner.ubuntu18 -t irods-runner-ubuntu18 .
- Run iRODS builder container:
$ docker run --rm \
-v /full/path/to/irods_repository_clone:/irods_source:ro \
-v /full/path/to/irods_build_output_dir:/irods_build \
-v /full/path/to/icommands_repository_clone:/icommands_source:ro \
-v /full/path/to/icommands_build_output_dir:/icommands_build \
-v /full/path/to/packages_output_dir:/irods_packages \
irods-core-builder-ubuntu16
Usage notes (available by running the above with -h):
Builds iRODS repository, installs the dev/runtime packages, and then builds iCommands
Available options:
--server-only Only builds the server
-j, --jobs Number of jobs to use with make
-h, --help This message
- Run iRODS Runner container:
$ docker run -d --name irods-runner-ubuntu16_whatever \
-v /full/path/to/packages_output_dir:/irods_packages:ro \
irods-runner-ubuntu16
- Open a shell inside the running container:
$ docker exec -it irods-runner-ubuntu16_whatever /bin/bash
Note: iRODS and iCommands are not installed out of the box, nor is the ICAT database prepared. The usual steps of an initial iRODS installation must be followed on first-time installation.
- Edit iRODS/iCommands source files...
- Build iRODS and iCommands (see "How to build")
- Install packages of interest on iRODS Runner (inside iRODS Runner container):
root@19b35a476e2d:/# dpkg -i /irods_packages/irods-{package_name(s)}.deb
- Test your changes
- Rinse and repeat
It is encouraged to build your own wrapper script with your commonly used volume mounts to make this process easier.
If coming to iRODS for the first time, a more automated approach will do for an introduction:
- Into a new or initially empty directory, clone this repository:
$ mkdir ~/dev_root
$ cd ~/dev_root ; git clone https://github.com/irods/irods_development_environment
- Also clone the source code repos from which to build:
$ git clone --recursive https://github.com/irods/irods
$ git clone https://github.com/irods/irods_client_icommands
- Create binary and package output directories:
$ mkdir irods_build_output icommands_build_output irods_package_output
- Now we can build and run model setup, using the source and output directories just created.
$ cd irods_development_environment
$ ./run_debugger.sh -d .. -V volumes.include.sh --debug
- This will build a docker image suitable for
- initially running an iRODS server (an old version) installed from the iRODS internet repo
- upgrading from there to a just-built iRODS server, eg. built from source
- leveraging debugging tools (currently
gdb
,rr
, andvalgrind
) against the running iRODS server (if we used--debug
as in the previous step)
- These are possible informative but otherwise no-op invocations of
run_debugger.sh
:- Explain usage:
$ ./run_debugger.sh -h
- Print out settings but do nothing.
$ ./run_debugger.sh -V volumes.include.sh -d .. --dry-run
- Notes
- When rebuilding, esp for another platform (-p), it may be necessary to clear the binary output directories
$ sudo cp -rp ~/dev_root ~/dev_root.ubuntu16.4-2-stable # (optionally preserve previous work) $ sudo rm -fr ~/dev_root/*_output/* ~/dev_root/*_output/.ninja*