https://github.com/opengovern/og-task-template
https://github.com/opengovern/og-task-template
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/opengovern/og-task-template
- Owner: opengovern
- License: apache-2.0
- Created: 2024-12-09T16:02:03.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-15T23:21:50.000Z (8 months ago)
- Last Synced: 2025-04-16T00:25:10.743Z (8 months ago)
- Language: Go
- Size: 33.2 KB
- Stars: 0
- Watchers: 0
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tasks Template
Define a Task Image for Run by Opencomply Platform. User Can Define a Task Image and Run it on Opencomply Platform.
You can fork this repository and create your own task image.
## Task Definition
Task is a set of instructions that can be executed by Opencomply Platform.
It should be run once every time it is executed. And have an output that can be written to a file.
Defining a task has one main parts:
### 1. Code
First part is the code that will be executed. It can be a shell script, python script, or any other executable file.
We Use [task.sh](worker/task.sh) as an example.
```shell
#!/bin/bash
echo "Hello World"
echo "This is an example task"
```
### 2. Build Image
Second part is the Dockerfile that will be used to build the task image.
You can use any base image you want, but it should have the necessary tools to run the go code.
Also If you want you can install additional tools or libraries.
```dockerfile
# Do not change the code below
# Run The Sender Go Application
FROM golang:1.23-alpine
# Copy the source code
COPY . .
# Download the dependencies
RUN cd sender && go mod download -x
# Build the Go application
RUN cd sender && go build -o task .
ENTRYPOINT ["./sender/task"]
```
We use [Dockerfile](./Dockerfile) for Building Image.