Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Rest improvements #3

Merged
merged 6 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 0 additions & 76 deletions .github/workflows/docker-build.yml

This file was deleted.

7 changes: 4 additions & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ name: Docker Build and Publish

on:
push:
branches: [ "main" ]
branches: [ "*" ]
# Publish semver tags as releases.
tags: [ '*' ]
schedule: # Run on Tuesday's at noon
- cron: '0 12 * * 2'

env:
# Use docker.io for Docker Hub if empty
Expand All @@ -21,7 +23,6 @@ env:
jobs:
build_and_publish:

# environment: production
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -61,7 +62,7 @@ jobs:
type=ref,event=pr
type=raw,value=latest,enable={{is_default_branch}}

# Build and push Docker image with Buildx (don't push on PR)
# Build and push Docker image with Buildx
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-yaml
- id: check-json
Expand All @@ -12,12 +12,12 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
rev: 0.7.1
hooks:
- id: nbstripout
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.10
rev: v0.4.9
hooks:
# Run the linter.
- id: ruff
Expand Down
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@

init: # Do the initial configuration of the project
@test -e .env || cp example.env .env
ifeq ($(shell uname),Darwin)
@sed -i '' 's|^PROJECT_PATH=.*|PROJECT_PATH=$(shell pwd | sed 's/\//\\\//g')|' .env
else
@sed -i 's/^PROJECT_PATH=.*/PROJECT_PATH=$(shell pwd | sed 's/\//\\\//g')/' .env
endif

.env: init

Expand Down
43 changes: 39 additions & 4 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
name: sleep_module
include:
- path: tests/wei.compose.yaml
env_file: .env
services:
sleep_module:
container_name: sleep_module
Expand All @@ -14,7 +11,45 @@ services:
volumes:
- ./src:/home/app/sleep_module/src
- ./tests:/home/app/sleep_module/tests
env_file: .env
command: python -m sleep_rest_node --port 2000
ports:
- 2000:2000
#####################
# WEI Core Services #
#####################
wei_server:
image: ghcr.io/ad-sdl/wei
container_name: wei_server
ports:
- 8000:8000
environment:
- PYTHONUNBUFFERED=1 # Fix weird bug with empty logging
- USER_ID=${USER_ID:-1000}
- GROUP_ID=${GROUP_ID:-1000}
volumes:
- ${WORKCELLS_DIR}:/workcell_defs
command: python3 -m wei.server --workcell /workcell_defs/${WORKCELL_FILENAME}
depends_on:
- wei_redis
profiles: [wei]
wei_engine:
image: ghcr.io/ad-sdl/wei
container_name: wei_engine
volumes:
- ${WORKCELLS_DIR}:/workcell_defs
environment:
- PYTHONUNBUFFERED=1 # Fix weird bug with empty logging
- USER_ID=${USER_ID:-1000}
- GROUP_ID=${GROUP_ID:-1000}
command: python3 -m wei.engine --workcell /workcell_defs/${WORKCELL_FILENAME}
depends_on:
- wei_redis
- wei_server
profiles: [wei]
wei_redis:
image: redis
container_name: wei_redis
ports:
- 6379:6379
command: redis-server --save 60 1 --loglevel warning
profiles: [wei]
4 changes: 1 addition & 3 deletions example.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# The PROJECT_PATH should be the absolute path to the root of the repo
PROJECT_PATH=
WORKCELL_FILENAME=test_workcell.yaml
WORKCELLS_DIR=${PROJECT_PATH}/tests/workcell_defs
WORKCELLS_DIR=./tests/workcell_defs
IMAGE=ghcr.io/ad-sdl/sleep_module
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "sleep_module"
version = "1.3.0"
version = "1.4.0"
description = "A simple example module that implements a sleep(t) function"
authors = [{name = "Ryan D. Lewis", email="[email protected]"}]
dependencies = [
Expand Down
Loading
Loading