-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ramses II
committed
Jun 14, 2024
1 parent
87bb0b7
commit 3ceca35
Showing
23 changed files
with
7,456 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,26 @@ | ||
*.pyc | ||
__pycache__/ | ||
job_manager.log | ||
*.pyc | ||
__pycache__/ | ||
job_manager.log | ||
.DS_Store | ||
.DS_Store | ||
node_modules | ||
/build | ||
/.svelte-kit | ||
/package | ||
.env | ||
.env.* | ||
vite.config.js.timestamp-* | ||
vite.config.ts.timestamp-* | ||
SECRET_CONFIG | ||
.idea | ||
!.env.ci | ||
!.env | ||
gcp-*.json | ||
.venv | ||
dist/ | ||
poetry.lock | ||
__pycache__ | ||
/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Use the official Python image from the Docker Hub | ||
FROM python:3.9-slim | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy the current directory contents into the container at /app | ||
COPY . /app | ||
|
||
# Install any needed packages specified in requirements.txt | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Make port 80 available to the world outside this container | ||
EXPOSE 80 | ||
|
||
# Define environment variable | ||
ENV NAME JobManager | ||
|
||
# Run job_manager.py when the container launches | ||
CMD ["python3", "job_manager.py", "run"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,58 @@ | ||
# Job Manager | ||
|
||
A simple job management system to handle job queues with priorities, implemented in Python. | ||
|
||
## Features | ||
|
||
- Add jobs to a queue with priority | ||
- Check the status of jobs | ||
- Execute jobs in the queue based on priority | ||
- Persist job states across restarts | ||
- Run jobs in the background using `nohup` and `screen` | ||
|
||
## Usage | ||
|
||
### Adding a Job | ||
|
||
```sh | ||
python3 job_manager.py add "your_command_here" [priority] | ||
``` | ||
|
||
### Checking Job Status | ||
|
||
```sh | ||
python3 job_manager.py status job_id | ||
``` | ||
|
||
### Running Jobs | ||
|
||
```sh | ||
./run_jobs.sh | ||
``` | ||
|
||
### Example | ||
|
||
```sh | ||
# Add a job with priority 10 | ||
python3 job_manager.py add "echo 'Hello, High Priority World!'" 10 | ||
|
||
# Check the status of the job | ||
python3 job_manager.py status 1 | ||
|
||
# Run the job manager to process the queue | ||
./run_jobs.sh | ||
``` | ||
|
||
### Requirements | ||
|
||
- Python 3.x | ||
- `screen` and `nohup` installed | ||
|
||
### Error Handling | ||
|
||
- Errors are logged in the `context.txt` file. | ||
- Jobs that fail are marked as `failed` and their status is persisted. | ||
|
||
### License | ||
|
||
This project is licensed under the MIT License. |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule serverwitch-api
added at
5bb040
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
Oops, something went wrong.