{"id":17030478,"url":"https://github.com/vsoch/ood-compose","last_synced_at":"2025-10-06T17:31:51.179Z","repository":{"id":42367622,"uuid":"193750315","full_name":"vsoch/ood-compose","owner":"vsoch","description":"Docker compose to bring up Open OnDemand with SLURM, Centos 7","archived":false,"fork":false,"pushed_at":"2022-09-14T21:26:34.000Z","size":847,"stargazers_count":23,"open_issues_count":9,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T12:12:13.951Z","etag":null,"topics":["docker-compose","on-demand","open-on-demand","slurm"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vsoch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-25T17:05:05.000Z","updated_at":"2024-12-04T10:50:37.000Z","dependencies_parsed_at":"2023-01-18T08:00:34.163Z","dependency_job_id":null,"html_url":"https://github.com/vsoch/ood-compose","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vsoch/ood-compose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsoch%2Food-compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsoch%2Food-compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsoch%2Food-compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsoch%2Food-compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vsoch","download_url":"https://codeload.github.com/vsoch/ood-compose/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsoch%2Food-compose/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278648827,"owners_count":26021977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-compose","on-demand","open-on-demand","slurm"],"created_at":"2024-10-14T08:07:07.099Z","updated_at":"2025-10-06T17:31:51.147Z","avatar_url":"https://github.com/vsoch.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Open On Demand Compose\n\nThis is an Open On Demand (OOD) instance installed with SLURM using docker-compose.\nWe use docker-compose to bring up a master node, worker nodes, and we store\ndata and log files in a mounted volume. The slurm configuration was adopted\nfrom [slurm-docker-cluster](https://github.com/giovtorres/slurm-docker-cluster)\ncombined with [ood-vagrant](https://github.com/OSC/ood-images-full/).\n\n\n## Getting Started\n\nThe base image for slurm is built by the Dockerfile in this repository. It\nserves slurm 18.08.6\n\n```bash\n$ docker build -t vanessa/slurm:18.08.6 .\n```\n\nIt's also available on [Docker Hub](https://hub.docker.com/r/vanessa/slurm),\nbut it's still useful for you to build on your own for the latest version.\nAfter this first build or pull, we then build the nodes, which have additional VNC libraries,\nand (if you have particular dependencies for apps) they are installed here:\n\n```bash\n$ docker-compose build\n```\n\nThen start the cluster:\n\n```bash\n$ docker-compose up -d\n```\n\nConfirm that containers are running:\n\n```bash\n$ docker-compose ps\n```\n```bash\n  Name                 Command               State             Ports           \n-------------------------------------------------------------------------------\nc1          /usr/local/bin/docker-entr ...   Up      6818/tcp                  \nc2          /usr/local/bin/docker-entr ...   Up      6818/tcp                  \nmysql       docker-entrypoint.sh mysqld      Up      3306/tcp, 33060/tcp       \nood         /usr/local/bin/docker-entr ...   Up      6817/tcp, 80/tcp, 8080/tcp\nslurmctld   /usr/local/bin/docker-entr ...   Up      6817/tcp                  \nslurmdbd    /usr/local/bin/docker-entr ...   Up      6819/tcp \n```\n\n## OnDemand Interface\n\nCurrently, you can get the ip address for the on demand interface via the ood logs:\n\n```bash\n$ docker-compose logs ood\nAttaching to ood\nood          | 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\n```\n\nIn the example above, we would go to `http://172.19.0.7` and see a login:\n\n![img/sign-in.png](img/sign-in.png)\n\n\nAnd then we would sign in to see the dashboard:\n\n![img/dashboard.png](img/dashboard.png)\n\nIf you click on Jobs -\u003e Active Jobs you will see the jobs interface.\n\n![img/jobs.png](img/jobs.png)\n\nAt this point, we want to launch a job! Shell into the container with the controller (master node):\n\n```bash\n$ docker exec -it slurmctld bash\n```\n\nTest that basic slurm commands are working:\n\n```bash\n[root@slurmctld /]# sinfo\nPARTITION AVAIL  TIMELIMIT  NODES  STATE NODELIST\nnormal*      up 5-00:00:00      2   idle c[1-2]\n```\n\n## Submitting Jobs\n\nFrom the `slurm-docker-cluster`, the `slurm_jobdir` volume is mounted on each  \nSlurm container as `/data`. Therefore, in order to see job output files while \non the controller, we can change directory to `/data` in this same container:\n\n```bash\n$ cd /data\n```\n\nAnd then submit a simple job.\n\n```bash\n$ sbatch --wrap=\"sleep 100\"\nSubmitted batch job 2\n```\n\nThe result file will be in the present working directory (`/data`):\n\n```bash\n$ ls\nslurm-2.out\n```\n\nBut more importantly, if you go to the onDemand interface, if you make sure that\nthe \"All Jobs\" is selected (and not \"Your Jobs\") you should see a job running,\nvia user root (the user you are in the Docker Container):\n\n![img/active-job.png](img/active-job.png)\n\n\nAnd when it completes, it will turn green.\n\n\n## Interactive Apps\n\nThe documentation said that I could add add apps to [ood-home/ondemand/dev](ood-home/ondemand/dev)\nand they would be available at `https://\u003chostname\u003e/pun/dev/\u003capp_directory\u003e`. I tried\nthis, and it didn't work. Notably, the user in the browser is ood, and\nso logically ood's home should work. Instead, I created an \"apps\" folder\nand then cloned the Rstudio app there. It's bound to the container\nvia a volume in the docker-compose.yml:\n\n```\n   - ./apps/RStudio:/var/www/ood/apps/sys/RStudio\n```\n\nAnd this is what you should do for any general app you want to use,\ntest, or develop. Binding as a subfolder within the `/var/www/ood/apps/sys` folder \nmeans that it will show up in the interface:\n\n![img/rstudio.png](img/rstudio.png)\n\nI also added the commands to install dependencies in the [Dockerfile.node](Dockerfile.node)\n\n**IMPORTANT** In order to run the Singularity container with rstudio,\nthe node (`c[1-2]`) containers are run in privileged mode. If you don't want to\nuse Singularity (and aren't comfortable with this) then remove the `privileged: true`\nlines from the docker-compose.yml, and remove the RStudio folder from apps.\nIf you do want to use Singularity and RStudio, you can launch an Interactive\nApp to get the interface:\n\n![img/rstudio-running.png](img/rstudio-running.png)\n\n```bash\n# Install for Rstudio App\nCOPY apps/RStudio/install-compute-dependencies.sh /install-rstudio.sh\nRUN /bin/bash /install-rstudio.sh\n```\n\nI won't go into detail about how an app is structured, but most\nof it is fairly intuitive if you look in the folder. Otherwise,\nthe OSC maintains good documentation for app development.\n\n### Developing your Own Apps\n\nThis means that, if you are interested in developing an app, you might:\n\n - start with a template from one of the examples [here](https://osc.github.io/ood-documentation/master/install-ihpc-apps.html)\n - ensure that dependencies are added to [Dockerfile.node](Dockerfile.node) for the cluster nodes `c[1-2]` or [Dockerfile](Dockerfile) for the main image.\n - 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`).\n - 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/\u003capplication\u003e/`.\n\nIf you have any questions, or fixes to the current setup, please [open an issue](https://www.github.com/vsoch/ood-compose/issues).\n\n## Cleaning Up\n\nIf you need to stop and start the cluster, you can do this:\n\n```bash\n$ docker-compose stop\n$ docker-compose start\n```\n\nor restart:\n\n```bash\n$ docker-compose restart\n```\n\nor bring down:\n\n```bash\n$ docker-compose down\n```\n\nWhen you want to delete the containers and really clean up:\n\n```console\n$ docker-compose stop\n$ docker-compose rm -f\n$ 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\n```\n\nAnd then open to that address to log in with `ood` and `ood` to see the interface.\nI need to update the hostname for the container so you don't need to do this.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsoch%2Food-compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvsoch%2Food-compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsoch%2Food-compose/lists"}