Skip to content

Commit

Permalink
sludge 0.1.0-alpha.1
Browse files Browse the repository at this point in the history
  • Loading branch information
samredai committed Nov 6, 2022
0 parents commit f848b29
Show file tree
Hide file tree
Showing 44 changed files with 2,633 additions and 0 deletions.
94 changes: 94 additions & 0 deletions .build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
FROM centos:7

LABEL org.opencontainers.image.source="https://github.com/giovtorres/slurm-docker-cluster" \
org.opencontainers.image.title="slurm-docker-cluster" \
org.opencontainers.image.description="Slurm Docker cluster on CentOS 7" \
org.label-schema.docker.cmd="docker-compose up -d" \
maintainer="Giovanni Torres"

ARG SLURM_TAG=slurm-22-05-3-1
ARG GOSU_VERSION=1.11

RUN set -ex \
&& yum makecache fast \
&& yum -y update \
&& yum -y install epel-release \
&& yum -y install \
wget \
bzip2 \
perl \
gcc \
gcc-c++\
git \
gnupg \
make \
munge \
munge-devel \
python-devel \
python-pip \
python34 \
python34-devel \
python34-pip \
mariadb-server \
mariadb-devel \
psmisc \
bash-completion \
vim-enhanced \
&& yum clean all \
&& rm -rf /var/cache/yum

RUN ln -s /usr/bin/python3.4 /usr/bin/python3

RUN pip install Cython nose && pip3.4 install Cython nose

RUN set -ex \
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-amd64" \
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-amd64.asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
&& rm -rf "${GNUPGHOME}" /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu \
&& gosu nobody true

RUN set -x \
&& git clone https://github.com/SchedMD/slurm.git \
&& pushd slurm \
&& git checkout tags/$SLURM_TAG \
&& ./configure --enable-debug --prefix=/usr --sysconfdir=/etc/slurm \
--with-mysql_config=/usr/bin --libdir=/usr/lib64 \
&& make install \
&& install -D -m644 etc/cgroup.conf.example /etc/slurm/cgroup.conf \
&& install -D -m644 etc/slurm.conf.example /etc/slurm/slurm.conf \
&& install -D -m644 etc/slurmdbd.conf.example /etc/slurm/slurmdbd.conf \
&& install -D -m644 contribs/slurm_completion_help/slurm_completion.sh /etc/profile.d/slurm_completion.sh \
&& popd \
&& rm -rf slurm \
&& groupadd -r --gid=995 slurm \
&& useradd -r -g slurm --uid=995 slurm \
&& mkdir /etc/sysconfig/slurm \
/var/spool/slurmd \
/var/run/slurmd \
/var/run/slurmdbd \
/var/lib/slurmd \
/var/log/slurm \
/data \
&& touch /var/lib/slurmd/node_state \
/var/lib/slurmd/front_end_state \
/var/lib/slurmd/job_state \
/var/lib/slurmd/resv_state \
/var/lib/slurmd/trigger_state \
/var/lib/slurmd/assoc_mgr_state \
/var/lib/slurmd/assoc_usage \
/var/lib/slurmd/qos_usage \
/var/lib/slurmd/fed_mgr_state \
&& chown -R slurm:slurm /var/*/slurm* \
&& /sbin/create-munge-key

ADD https://go.dev/dl/go1.19.2.linux-amd64.tar.gz /etc/slurm/
RUN tar -C /root -xvf /etc/slurm/go1.19.2.linux-amd64.tar.gz
ENV PATH=$PATH:/root/go/bin
ENV PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/root/sludge
WORKDIR /root/sludge

ENTRYPOINT ["/bin/sh", "./entrypoint.sh"]
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
on:
release:
types: [created]

jobs:
build-and-release:
runs-on: ubuntu-latest
strategy:
matrix:
GOOS: [linux]
GOARCH: [amd64]
steps:
- name: Check Sludge Repo
uses: actions/checkout@v3
- name: Build the Docker Build Image
run: docker build -t build-sludge .build
- name: Build Sludge Binary
run: docker run -v ${PWD}:/root/sludge -t build-sludge ${{ matrix.GOOS }} ${{ matrix.GOARCH }} sludge-${{ matrix.GOOS }}-${{ matrix.GOARCH }}
- name: Modify Binary Permissions
run: sudo chmod +x sludge-${{ matrix.GOOS }}-${{ matrix.GOARCH }}
- name: Release All Binaries
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
sludge-${{ matrix.GOOS }}-${{ matrix.GOARCH }}
47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work

sludge

*.tar.gz

.DS_Store

# Hugo .gitignore
# Generated files by hugo
docs/public/
docs/resources/_gen/
docs/assets/jsconfig.json
docs/hugo_stats.json

# Executable may be added to repository
docs/hugo.exe
docs/hugo.darwin
docs/hugo.linux

# Temporary lock file while building
docs/.hugo_build.lock

.hugo_build.lock
tmpwdir
*.err
*.out
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "docs/themes/PaperMod"]
path = docs/themes/PaperMod
url = https://github.com/adityatelange/hugo-PaperMod.git
79 changes: 79 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
![sludge-logo](docs/static/images/sludge-logo2.png)

Sludge is a terminal UI for [SLURM](https://slurm.schedmd.com/documentation.html), a cluster management and job scheduling system.
To learn more about it, head over to the [documentation](https://www.sludgeui.com) site.

# Installation

## Linux

Create a `bin` directory and download the sludge binary there.
```sh
mkdir -p $HOME/bin
cd $HOME/bin
wget -P $HOME/bin https://github.com/samredai/sludge/releases/download/0.1.7rc/sludge-linux-amd64 -O sludge
```

Add the bin directory to your `PATH` variable.
```sh
export PATH=$HOME/bin:$PATH
```

# Usage

The sludge terminal UI can be opened using the `sludge` command.
```sh
sludge
```
[![welcome-page](docs/static/images/welcome-page.png)](docs/static/images/welcome-page.png)

The sludge UI can be closed using either `Ctrl+C` or `Ctrl+D`.

## Filtering to a Specific User

The `--username` argument opens sludge with all views filtered to a specific user.
```sh
sludge --username samredai
```

## Filtering to a Specific Account

The `--account` argument opens sludge with all views filtered to a specific account.
```sh
sludge --account heavy_metal_lab
```

## Jobs Page

You can view all jobs on the SLURM cluster by going to the jobs page `[Ctrl+J]`. Selecting a job will reveal more information about the job in the center pane, such as number of nodes, number of CPUs, and the number of threads per core.

[![job-details](docs/static/images/job-details.png)](docs/static/images/job-details.png)

## Nodes Page

You can view all nodes on the SLURM cluster by going to the nodes page `[Ctrl+N]`. Selecting a node will reveal more information about the node in the center pane, such as the architechture, the number of cores and the CPU load.

## Reports Page

Sludge lets you run various reports on the SLURM cluster and displays the results. On the reports page `[Ctrl+R]`, you can select which report you want to run in the left pane. Once the results are ready, they will be displayed in the center pane. The reports are submitted using the `sreport` command line utility that comes with SLURM.

[![reports-page](docs/static/images/reports-page.png)](docs/static/images/reports-page.png)

# Actions

The actions menus can be found in the top right pane and contains various forms that can be used to run common actions against the SLURM cluster such as submitting a script using `sbatch` or running an analysis to determine the best partition for a particular script.

## Submit Script Action

You can submit a script to run on the SLURM cluster using the `Submit Script` action. In addition to the script name, you can include additional sbatch options as arguments.
See the [sbatch](https://slurm.schedmd.com/sbatch.html) documentation to see all available options.

[![submit-script-action](docs/static/images/submit-script-action.png)](docs/static/images/submit-script-action.png)

## Find Best Partition Action

You can find the SLURM partition with the minimum delay for starting a particular script using the Find Best Partition action. This uses the open source [BestSlurmPartition](https://github.com/fasrc/best_slurm_partition) utility created by the research computing team at the Harvard Faculty of Arts & Sciences (FASRC).

To use the action, simply select it in the actions pane and enter the path to the script you’d like to find the best partition for. Relative paths are calculated from the directory where the sludge UI was launched.

[![find-best-partition-action](docs/static/images/find-best-partition-action.png)](docs/static/images/find-best-partition-action.png)
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docker build --build-arg SLURM_TAG="slurm-22-05-3-1" -t build-sludge .
docker run -it -v ${PWD}:/root/sludge build-sludge
51 changes: 51 additions & 0 deletions docs/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
baseURL: http://localhost:1313
languageCode: en-us
title: Sludge Documentation
theme: "PaperMod"

menu:
main:
- name: Documentation
url: docs
weight: 10
- name: FAQs
url: faqs
weight: 20
- name: samredai/sludge
url: https://github.com/samredai/sludge
weight: 30

params:
description: "Sludge - https://github.com/samredai/sludge"
disableThemeToggle: true
ShowShareButtons: true
ShowReadingTime: true
displayFullLangName: true
ShowPostNavLinks: true
ShowBreadCrumbs: true
ShowCodeCopyButtons: true
ShowRssButtonInSectionTermList: true
ShowToc: true
images: ["papermod-cover.png"]

profileMode:
enabled: true
title: A Terminal UI For SLURM
imageUrl: "/images/sludge-logo2.png"
imageTitle: sludge-logo
imageWidth: 659
imageHeight: 238
buttons:
- name: Documentation
url: docs
- name: FAQs
url: faqs

socialIcons:
- name: GitHub
url: "https://github.com/samredai/sludge"

markup:
goldmark:
renderer:
unsafe: true
81 changes: 81 additions & 0 deletions docs/content/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
title: "Sludge Documentation"
tags: ["sludge", "docs", "slurm", "hpc", "tview", "golang"]
ShowToc: true
TocOpen: true
---

# Installation

## Linux

Create a `bin` directory and download the sludge binary there.
```sh
mkdir -p $HOME/bin
cd $HOME/bin
wget -P $HOME/bin https://github.com/samredai/sludge/releases/download/0.1.7rc/sludge-linux-amd64 -O sludge
```

Add the bin directory to your `PATH` variable.
```sh
export PATH=$HOME/bin:$PATH
```

# Usage

The sludge terminal UI can be opened using the `sludge` command.
```sh
sludge
```
[![welcome-page](/images/welcome-page.png)](/images/welcome-page.png)

The sludge UI can be closed using either `Ctrl+C` or `Ctrl+D`.

## Filtering to a Specific User

The `--username` argument opens sludge with all views filtered to a specific user.
```sh
sludge --username samredai
```

## Filtering to a Specific Account

The `--account` argument opens sludge with all views filtered to a specific account.
```sh
sludge --account heavy_metal_lab
```

## Jobs Page

You can view all jobs on the SLURM cluster by going to the jobs page `[Ctrl+J]`. Selecting a job will reveal more information about the job in the center pane, such as number of nodes, number of CPUs, and the number of threads per core.

[![job-details](/images/job-details.png)](/images/job-details.png)

## Nodes Page

You can view all nodes on the SLURM cluster by going to the nodes page `[Ctrl+N]`. Selecting a node will reveal more information about the node in the center pane, such as the architechture, the number of cores and the CPU load.

## Reports Page

Sludge lets you run various reports on the SLURM cluster and displays the results. On the reports page `[Ctrl+R]`, you can select which report you want to run in the left pane. Once the results are ready, they will be displayed in the center pane. The reports are submitted using the `sreport` command line utility that comes with SLURM.

[![reports-page](/images/reports-page.png)](/images/reports-page.png)

# Actions

The actions menus can be found in the top right pane and contains various forms that can be used to run common actions against the SLURM cluster such as submitting a script using `sbatch` or running an analysis to determine the best partition for a particular script.

## Submit Script Action

You can submit a script to run on the SLURM cluster using the `Submit Script` action. In addition to the script name, you can include additional sbatch options as arguments.
See the [sbatch](https://slurm.schedmd.com/sbatch.html) documentation to see all available options.

[![submit-script-action](/images/submit-script-action.png)](/images/submit-script-action.png)

## Find Best Partition Action

You can find the SLURM partition with the minimum delay for starting a particular script using the Find Best Partition action. This uses the open source [BestSlurmPartition](https://github.com/fasrc/best_slurm_partition) utility created by the research computing team at the Harvard Faculty of Arts & Sciences (FASRC).

To use the action, simply select it in the actions pane and enter the path to the script you’d like to find the best partition for. Relative paths are calculated from the directory where the sludge UI was launched.

[![find-best-partition-action](/images/find-best-partition-action.png)](/images/find-best-partition-action.png)
Loading

0 comments on commit f848b29

Please sign in to comment.