Giter Site home page Giter Site logo

ood-compose's Introduction

Open On Demand Compose

This is an Open On Demand (OOD) instance installed with SLURM using docker-compose. We use docker-compose to bring up a master node, worker nodes, and we store data and log files in a mounted volume. The slurm configuration was adopted from slurm-docker-cluster combined with ood-vagrant.

Getting Started

The base image for slurm is built by the Dockerfile in this repository. It serves slurm 18.08.6

$ docker build -t vanessa/slurm:18.08.6 .

It's also available on Docker Hub, but it's still useful for you to build on your own for the latest version. After this first build or pull, we then build the nodes, which have additional VNC libraries, and (if you have particular dependencies for apps) they are installed here:

$ docker-compose build

Then start the cluster:

$ docker-compose up -d

Confirm that containers are running:

$ docker-compose ps
  Name                 Command               State             Ports           
-------------------------------------------------------------------------------
c1          /usr/local/bin/docker-entr ...   Up      6818/tcp                  
c2          /usr/local/bin/docker-entr ...   Up      6818/tcp                  
mysql       docker-entrypoint.sh mysqld      Up      3306/tcp, 33060/tcp       
ood         /usr/local/bin/docker-entr ...   Up      6817/tcp, 80/tcp, 8080/tcp
slurmctld   /usr/local/bin/docker-entr ...   Up      6817/tcp                  
slurmdbd    /usr/local/bin/docker-entr ...   Up      6819/tcp 

OnDemand Interface

Currently, you can get the ip address for the on demand interface via the ood logs:

$ docker-compose logs ood
Attaching to ood
ood          | AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.19.0.7. Set the 'ServerName' directive globally to suppress this message

In the example above, we would go to http://172.19.0.7 and see a login:

img/sign-in.png

And then we would sign in to see the dashboard:

img/dashboard.png

If you click on Jobs -> Active Jobs you will see the jobs interface.

img/jobs.png

At this point, we want to launch a job! Shell into the container with the controller (master node):

$ docker exec -it slurmctld bash

Test that basic slurm commands are working:

[root@slurmctld /]# sinfo
PARTITION AVAIL  TIMELIMIT  NODES  STATE NODELIST
normal*      up 5-00:00:00      2   idle c[1-2]

Submitting Jobs

From the slurm-docker-cluster, the slurm_jobdir volume is mounted on each
Slurm container as /data. Therefore, in order to see job output files while on the controller, we can change directory to /data in this same container:

$ cd /data

And then submit a simple job.

$ sbatch --wrap="sleep 100"
Submitted batch job 2

The result file will be in the present working directory (/data):

$ ls
slurm-2.out

But more importantly, if you go to the onDemand interface, if you make sure that the "All Jobs" is selected (and not "Your Jobs") you should see a job running, via user root (the user you are in the Docker Container):

img/active-job.png

And when it completes, it will turn green.

Interactive Apps

The documentation said that I could add add apps to ood-home/ondemand/dev and they would be available at https://<hostname>/pun/dev/<app_directory>. I tried this, and it didn't work. Notably, the user in the browser is ood, and so logically ood's home should work. Instead, I created an "apps" folder and then cloned the Rstudio app there. It's bound to the container via a volume in the docker-compose.yml:

   - ./apps/RStudio:/var/www/ood/apps/sys/RStudio

And this is what you should do for any general app you want to use, test, or develop. Binding as a subfolder within the /var/www/ood/apps/sys folder means that it will show up in the interface:

img/rstudio.png

I also added the commands to install dependencies in the Dockerfile.node

IMPORTANT In order to run the Singularity container with rstudio, the node (c[1-2]) containers are run in privileged mode. If you don't want to use Singularity (and aren't comfortable with this) then remove the privileged: true lines from the docker-compose.yml, and remove the RStudio folder from apps. If you do want to use Singularity and RStudio, you can launch an Interactive App to get the interface:

img/rstudio-running.png

# Install for Rstudio App
COPY apps/RStudio/install-compute-dependencies.sh /install-rstudio.sh
RUN /bin/bash /install-rstudio.sh

I won't go into detail about how an app is structured, but most of it is fairly intuitive if you look in the folder. Otherwise, the OSC maintains good documentation for app development.

Developing your Own Apps

This means that, if you are interested in developing an app, you might:

  • start with a template from one of the examples here
  • ensure that dependencies are added to Dockerfile.node for the cluster nodes c[1-2] or Dockerfile for the main image.
  • remember to do docker-compose build and then completely remove old containers (docker-compose stop and docker-compose rm) and then bring them up again (docker-compose up -d).
  • Start sessions via the interactive sessions tab in the dashboard, and then debug by looking at output logs in ood-home/ondemand/data/sys/dashboard/batch_connect/sys/<application>/.

If you have any questions, or fixes to the current setup, please open an issue.

Cleaning Up

If you need to stop and start the cluster, you can do this:

$ docker-compose stop
$ docker-compose start

or restart:

$ docker-compose restart

or bring down:

$ docker-compose down

When you want to delete the containers and really clean up:

$ docker-compose stop
$ docker-compose rm -f
$ docker volume rm slurm-docker-cluster_etc_munge slurm-docker-cluster_etc_slurm slurm-docker-cluster_slurm_jobdir slurm-docker-cluster_var_lib_mysql slurm-docker-cluster_var_log_slurm

And then open to that address to log in with ood and ood to see the interface. I need to update the hostname for the container so you don't need to do this.

ood-compose's People

Contributors

vsoch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ood-compose's Issues

SSL to make http -> https?

I don't see anything about ssl on the docker-compose.yml or Dockerfile. Would this be something I'd have to add on top of copying over the container, and images?

Apache needs hostname set to "ood"

I figured it would be in the portal configuration file, but setting:

servername: ood

Didn't seem to do anything. So we need a solution to this message - specifically, where is the apache.conf file (it's not in the traditional spot) and then what's the best way to change it.

ood          | AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.19.0.7. Set the 'ServerName' directive globally to suppress this message

Interactive apps and cluster configuration

Hello, I am trying to setup OOD for my organization in their HPC environment. I've been able to go through all the installation steps without any errors and have also been able to see the slurm jobs under "All Jobs". However, I am facing errors with the "Interactive apps" and see a permission error.
Unable to use previously cached values, using defaults instead. (Permission denied @ dir_s_mkdir - /home/ood/ondemand/data
I also am not a 100% how to provide the cluster configuration.

Any help would be greatly appreciated.

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.