Code Monkey home page Code Monkey logo

irods_development_environment's Introduction

iRODS Development Environment

This repository contains tools for the running troubleshooting of a Docker-containerized iRODS server.

Contents of this Guide

  1. General Setup
    1. Prerequisites
    2. How to Build
    3. How to Run
    4. How to Develop
  2. Simplified Setup
  3. Debugging
    1. gdb
    2. rr
    3. valgrind
    4. ( cppcheck, clang static analyzer, ... ?)

General Setup

Prerequisites

  1. 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
  1. 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.

  1. 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 .

How to build (e.g. Ubuntu 16)

  1. 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

How to run (e.g. Ubuntu 16)

  1. 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
  1. 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.

How to develop (e.g. Ubuntu 16)

  1. Edit iRODS/iCommands source files...
  2. Build iRODS and iCommands (see "How to build")
  3. Install packages of interest on iRODS Runner (inside iRODS Runner container):
root@19b35a476e2d:/# dpkg -i /irods_packages/irods-{package_name(s)}.deb
  1. Test your changes
  2. Rinse and repeat

It is encouraged to build your own wrapper script with your commonly used volume mounts to make this process easier.


Simplified Setup

If coming to iRODS for the first time, a more automated approach will do for an introduction:

  1. 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
  1. 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
  1. Create binary and package output directories:
$ mkdir irods_build_output icommands_build_output irods_package_output
  1. 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
  1. 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, and valgrind) against the running iRODS server (if we used --debug as in the previous step)
  1. 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
    
  2. 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*
    

irods_development_environment's People

Contributors

trel avatar alanking avatar korydraughn avatar d-w-moore avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.