Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
7a9990b
Admin tweaks
RyanTheRobothead Mar 20, 2024
d09fccc
The great data class refactor
RyanTheRobothead Mar 20, 2024
6cd33ab
Experimenting with Event Dataclasses
RyanTheRobothead Mar 20, 2024
3410793
Making room for experiment datapoints
RyanTheRobothead Mar 21, 2024
460084a
Merge branch 'main' into experiment_enhancements
RyanTheRobothead Mar 21, 2024
db44d0e
Resolving circular dependencies, fixing tests
RyanTheRobothead Mar 21, 2024
22c5622
Fix loggers submodule
RyanTheRobothead Mar 21, 2024
97d51f4
Thread some potentially blocking tasks to reduce lockup
RyanTheRobothead Mar 21, 2024
ac79606
Fixes from colorpicker testing
RyanTheRobothead Mar 21, 2024
1531853
Merge branch 'main' into experiment_enhancements
RyanTheRobothead Mar 22, 2024
a0c597d
WIP on event improvements
RyanTheRobothead Mar 25, 2024
cc388cc
Fixing experiment endpoints, refactor events
RyanTheRobothead Mar 26, 2024
e1e4be3
Cleaning up logging a bit
RyanTheRobothead Mar 26, 2024
615b134
Streamlining and improving events
RyanTheRobothead Mar 27, 2024
5e37abc
Remove Experiment Design File, sketching resources
RyanTheRobothead Mar 28, 2024
fccab2f
Add endpoints for workcell definition and config
RyanTheRobothead Apr 2, 2024
a8b2f64
Collocate file-io functions
RyanTheRobothead Apr 3, 2024
74b5321
Finalize storage functions
RyanTheRobothead Apr 26, 2024
343d4bc
Merge branch 'main' into experiment_enhancements
RyanTheRobothead Apr 26, 2024
d55cbbb
WIP implementation of a module library
RyanTheRobothead Apr 29, 2024
9e282cf
Tweaking inline docs
RyanTheRobothead Apr 29, 2024
1bf20aa
WIP with decorators
RyanTheRobothead May 2, 2024
7907134
Experimenting with Decorators; UI generator
RyanTheRobothead May 7, 2024
13ff5c9
Fixing args processing
RyanTheRobothead May 9, 2024
8ee153e
Experiment log routes handle missing log files
RyanTheRobothead May 14, 2024
dc65796
Further developments on admin action
RyanTheRobothead May 20, 2024
1bb1257
Tweaks to file passing; improvements for admin commands
RyanTheRobothead May 23, 2024
a442f6e
Add debugging line for upload files
RyanTheRobothead May 23, 2024
ec0df79
More verbose debugging
RyanTheRobothead May 23, 2024
d7c8d20
Ensure paths parsed from disk are absolute
RyanTheRobothead May 23, 2024
8771ca6
fixing redis_read bug
tginsbu1 May 28, 2024
9ad2984
Latest improvments to new module class (lots of decorators and magic)
RyanTheRobothead May 29, 2024
2637aaf
Fixes for 3.8 typing problems
RyanTheRobothead May 30, 2024
92fd7a0
Fix python version comparison
RyanTheRobothead May 30, 2024
db86c3b
Fix DecisionEvent
RyanTheRobothead May 30, 2024
6e91b91
Fix experiment client missing experiment_id
RyanTheRobothead May 30, 2024
b675edb
Light refactoring of REST module, simplifying gha builds
RyanTheRobothead May 31, 2024
c6bf7c5
More improvements to rest module; rename estop -> safety_stop
RyanTheRobothead Jun 3, 2024
0c73bf7
Merge pull request #118 from AD-SDL/experiment_enhancements
RyanTheRobothead Jun 4, 2024
7e5bd2f
adding ui
tginsbu1 Jun 4, 2024
178973b
fixing modules
RyanTheRobothead Jun 5, 2024
5b2a1cb
adding ui
tginsbu1 Jun 6, 2024
8fed247
fixing args
RyanTheRobothead Jun 6, 2024
e3cc71c
fixing args
RyanTheRobothead Jun 6, 2024
c2c1993
fixing args
RyanTheRobothead Jun 6, 2024
650f81e
fixing args
RyanTheRobothead Jun 6, 2024
5c6d210
fixing file response
RyanTheRobothead Jun 6, 2024
ea62a13
fixing file response
RyanTheRobothead Jun 6, 2024
8e85392
fixing responses
Dozgulbas Jun 6, 2024
50012a2
Attempt to handle files return from windows modules better
RyanTheRobothead Jun 6, 2024
4dfcd0d
Simplify wei data dir folder structure
RyanTheRobothead Jun 6, 2024
16e77de
Remove required modules list in workflows, update diaspora dependency
RyanTheRobothead Jun 7, 2024
a3e05e2
adding files to measure
tginsbu1 Jun 7, 2024
d341d7e
currently building
tginsbu1 Jun 7, 2024
77bef5d
fixing experiment request
tginsbu1 Jun 7, 2024
12dedf1
Pre-commit checks
RyanTheRobothead Jun 7, 2024
53b94e4
fixing pyproject and switching to src
tginsbu1 Jun 7, 2024
6211c87
Merge branch 'adding_ui' of https://github.com/AD-SDL/wei into adding_ui
tginsbu1 Jun 7, 2024
c53eab5
Fix package layout
RyanTheRobothead Jun 7, 2024
fe21e79
Cleanup comments
RyanTheRobothead Jun 7, 2024
56bb41f
Update pre-commit hooks
RyanTheRobothead Jun 7, 2024
3d33633
Merge branch 'dev' into adding_ui
tginsbu1 Jun 7, 2024
c9453de
Passing pre-commit
RyanTheRobothead Jun 7, 2024
16252f1
Merge pull request #120 from AD-SDL/adding_ui
tginsbu1 Jun 7, 2024
1666600
adding Location type annotation
tginsbu1 Jun 10, 2024
35712a5
Fix merge conflicts
RyanTheRobothead Jun 10, 2024
3e2a1d8
Merge branch 'dev' into fix_windows_file_return
RyanTheRobothead Jun 10, 2024
12ae8a4
adding Location type annotation
tginsbu1 Jun 10, 2024
0f0ea51
Merge branch 'dev' into fix_windows_file_return
RyanTheRobothead Jun 10, 2024
c174a7c
Passing tests, checks
RyanTheRobothead Jun 10, 2024
333abfd
Merge pull request #119 from AD-SDL/fix_windows_file_return
RyanTheRobothead Jun 10, 2024
f21b8d4
Fix for type hinting backcompat
RyanTheRobothead Jun 12, 2024
ea8b5b1
Cleanup
RyanTheRobothead Jun 13, 2024
9bf451d
Cleaning up error outputs and adding custom args to test node
RyanTheRobothead Jun 13, 2024
677e5b1
Smarter handling for startup handler status setting
RyanTheRobothead Jun 14, 2024
601e988
Update docs
RyanTheRobothead Jun 14, 2024
4f5031f
Refactor Dockerfile for cache friendliness
RyanTheRobothead Jun 17, 2024
7cc8680
Addressing PR review
RyanTheRobothead Jun 17, 2024
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/node_modules
76 changes: 0 additions & 76 deletions .github/workflows/docker-build.yml

This file was deleted.

10 changes: 5 additions & 5 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 All @@ -37,10 +38,9 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# Login against a Docker registry except on PR
# Login against a Docker registry
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
Expand All @@ -61,7 +61,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)
Comment thread
RyanTheRobothead marked this conversation as resolved.
# 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,6 @@ test_experiment/

# Output data
.wei/

#node modules
**/node_modules
4 changes: 2 additions & 2 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 @@ -17,7 +17,7 @@ repos:
- id: nbstripout
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.2
rev: v0.4.8
hooks:
# Run the linter.
- id: ruff
Expand Down
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ LABEL org.opencontainers.image.licenses=MIT
RUN set -eux; \
apt-get update; \
apt-get install -y gosu; \
apt-get install -y npm; \
rm -rf /var/lib/apt/lists/*

# User configuration
Expand All @@ -29,18 +30,24 @@ COPY requirements/dev.txt wei/requirements/dev.txt
RUN --mount=type=cache,target=/root/.cache \
pip install -r wei/requirements/requirements.txt

# Copy wei files
COPY wei wei/wei
# Install Node Dependencies first, for caching purposes
COPY ./src/ui/package*.json ./
RUN npm install

# Copy rest of wei files
COPY src wei/src
COPY tests wei/tests
COPY pyproject.toml wei/pyproject.toml
COPY README.md wei/README.md
COPY scripts wei/scripts


# Install dependencies and wei
RUN --mount=type=cache,target=/root/.cache \
pip install -e wei

COPY wei-entrypoint.sh /wei-entrypoint.sh
RUN chmod +x /wei-entrypoint.sh
ENTRYPOINT [ "/wei-entrypoint.sh" ]

# build ui for production with minification
RUN npm run build --prefix wei/src/ui
18 changes: 6 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,35 @@
################################################################################
.DEFAULT_GOAL := init

.PHONY: init paths checks test clean
.PHONY: init checks test clean

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


.env: init

paths: .env # Create the necessary data directories
@mkdir -p $(shell grep -E '^WEI_DATA_DIR=' .env | cut -d '=' -f 2)
@mkdir -p $(shell grep -E '^REDIS_DIR=' .env | cut -d '=' -f 2)

checks: # Runs all the pre-commit checks
@pre-commit install
@pre-commit run --all-files || { echo "Checking fixes\n" ; pre-commit run --all-files; }

test: init .env paths # Runs all the tests
@docker compose up --build -d
@docker compose run test_app pytest -p no:cacheprovider wei
@docker compose down
test: init .env build # Runs all the tests
@docker compose up -d
@docker compose run wei_engine pytest -p no:cacheprovider wei
@#docker compose down

clean:
@rm .env

.PHONY += docs
docs: wei docs/source # Builds the docs for wei
docs: src docs/source # Builds the docs for wei
cd docs && pdm run make clean html

build: build-python # Builds the project
Expand Down
68 changes: 22 additions & 46 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,55 +1,25 @@
services:
###########
# Dev App #
###########
test_app:
container_name: test_app
image: ${IMAGE_TEST}
build:
context: tests/
dockerfile: ${DOCKERFILE_TEST}
tags:
- ${IMAGE_TEST}:latest
- ${IMAGE_TEST}:dev
volumes:
- ${WORKCELLS_DIR}:/workcell_defs
- ${WEI_DATA_DIR}:/home/app/.wei
- diaspora_config:/home/app/.diaspora
- ${PROJECT_DIR}:/home/app/wei # for development only
env_file:
- .env
profiles:
- test
command: pytest -p no:cacheprovider wei
depends_on:
- synthesis
- transfer
- measure
- wei_server
- wei_engine
- wei_redis

###########
# Modules #
###########
synthesis:
image: ${IMAGE_TEST}
image: ${IMAGE}
container_name: synthesis
ports:
- 2000:2000
command: 'python3 wei/tests/test_module/test_rest_node.py
--port 2000
--alias synthesis'
transfer:
image: ${IMAGE_TEST}
image: ${IMAGE}
container_name: transfer
ports:
- 2001:2001
command: 'python3 wei/tests/test_module/test_rest_node.py
--port 2001
--alias transfer'
measure:
image: ${IMAGE_TEST}
image: ${IMAGE}
container_name: measure
ports:
- 2002:2002
Expand All @@ -72,26 +42,29 @@ services:
ports:
- 8000:8000
volumes:
- ${WORKCELLS_DIR}:/workcell_defs
- ${WEI_DATA_DIR}:/home/app/.wei
- diaspora_config:/home/app/.diaspora
- ${PROJECT_DIR}:/home/app/wei # for development only
env_file:
- .env
- ./tests/workcells:/workcell_defs
- ~/.wei:/home/app/.wei

environment:
- PYTHONUNBUFFERED=1 # Fix weird bug with empty logging
Comment thread
RyanTheRobothead marked this conversation as resolved.
- USER_ID=${USER_ID:-1000}
- GROUP_ID=${GROUP_ID:-1000}
command: python3 -m wei.server --workcell /workcell_defs/${WORKCELL_FILENAME}
depends_on:
- wei_redis
wei_engine:
image: ${IMAGE}
container_name: wei_engine
volumes:
- ${WORKCELLS_DIR}:/workcell_defs
- ${WEI_DATA_DIR}:/home/app/.wei
- ${PROJECT_DIR}:/home/app/wei # for development only
- diaspora_config:/home/app/.diaspora
- ./tests/workcells:/workcell_defs
- ~/.wei:/home/app/.wei
- ./:/home/app/wei # for development only
environment:
- PYTHONUNBUFFERED=1 # Fix weird bug with empty logging
env_file:
- .env
- PYTHONUNBUFFERED=1 # Fix weird bug with empty logging
Comment thread
RyanTheRobothead marked this conversation as resolved.
- USER_ID=${USER_ID:-1000}
- GROUP_ID=${GROUP_ID:-1000}
command: python3 -m wei.engine --workcell /workcell_defs/${WORKCELL_FILENAME}
depends_on:
- wei_redis
Expand All @@ -102,8 +75,11 @@ services:
ports:
- 6379:6379
volumes:
- ${REDIS_DIR}:/data
command: redis-server --save 60 1 --loglevel warning
- ~/.wei/redis:/data
command: 'redis-server
--save 600 1
--loglevel warning
--appendonly yes'

################
# Data Storage #
Expand Down
3 changes: 3 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
"members": True,
}

autodoc_pydantic_model_show_json_error_strategy = "warn"


# Napoleon settings
napoleon_google_docstring = True
napoleon_numpy_docstring = True
Expand Down
3 changes: 0 additions & 3 deletions docs/source/pages/_autosummary/wei.core.admin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@ wei.core.admin
.. autosummary::

send_cancel
send_estop
send_lock
send_pause
send_reset
send_resume
send_safety_stop
send_shutdown
send_unlock



Expand Down
Loading