Skip to content

Commit

Permalink
update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
rvhonorato committed Nov 26, 2024
1 parent d6ef354 commit 9ea2251
Showing 1 changed file with 42 additions and 9 deletions.
51 changes: 42 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,40 @@
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ae50eb8e1303415f981ec755f0b8a28f)](https://app.codacy.com/gh/rvhonorato/jobd/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/ae50eb8e1303415f981ec755f0b8a28f)](https://app.codacy.com/gh/rvhonorato/jobd/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)

_documentation wip_

`jobd` is a lightweight Golang application designed to facilitate interaction with research software through REST APIs. It is specifically engineered to be deployed in multi-stage Docker builds, providing a flexible and portable solution for job management and file transfer.
`jobd` is a lightweight Golang application designed to facilitate interaction with
research software through REST APIs. It is specifically engineered to be deployed
in multi-stage Docker builds, providing a flexible and portable solution for job
management and file transfer.

## Key Features

Implements two primary REST API endpoints:

- `/upload`: Allows backend systems or scripts to upload files to the container
- `/download`: Enables retrieval of files from the container

## Usage

The application is optimized for containerized environments,
supporting multi-stage build patterns or simple binary execution.

## Docker Integration
The application is optimized for containerized environments, supporting multi-stage build patterns. In the example dockerfile:
In both ways the `jobd` version can be passed as a build argument:

```bash
docker build --build-arg JOBD_VERSION=v0.1.0 .
```

### Multi-stage build

First stage pulls the jobd executable from a specific image
Second stage incorporates the executable into a base research container
Enables seamless integration of job management capabilities into existing research software containers
Enables seamless integration of job management capabilities into existing research
software containers

```dockerfile
# Stage 1: Copy jobd executable
FROM ghcr.io/rvhonorato/jobd:latest AS jobd
ARG JOBD_VERSION=latest
FROM ghcr.io/rvhonorato/jobd:${JOBD_VERSION} AS jobd

# Stage 2: Base research image
FROM ghcr.io/haddocking/arctic3d:v0.5.1 AS base

WORKDIR /data
Expand All @@ -36,11 +47,33 @@ COPY --from=jobd /path/to/jobd /bin/jobd
ENTRYPOINT [ "/bin/jobd" ]
```

### Binary execution

```dockerfile
FROM ghcr.io/haddocking/arctic3d:v0.5.1
WORKDIR /data

ARG JOBD_VERSION=v0.1.0
ARG JOBD_ARCH=linux_386

# Download and extract jobd binary
ADD https://github.com/rvhonorato/jobd/releases/download/${JOBD_VERSION}/jobd_${JOBD_VERSION}_${JOBD_ARCH}.tar.gz /tmp/
RUN tar -xzf /tmp/jobd_${JOBD_VERSION}_${JOBD_ARCH}.tar.gz -C /bin/ \
&& chmod +x /bin/jobd \
&& rm /tmp/jobd_${JOBD_VERSION}_${JOBD_ARCH}.tar.gz

ENTRYPOINT [ "/bin/jobd" ]
```

## Use Cases

- Microservice-based job submission and file handling
- Simplified API interfaces for research software workflows

## API description

Soon!

## Technical Characteristics

- Written in Golang for performance and simplicity
Expand Down

0 comments on commit 9ea2251

Please sign in to comment.