Skip to content

Commit

Permalink
improve README, update MAKEFILE, add TODO to Dockerfile, and add SHA …
Browse files Browse the repository at this point in the history
…tag to CI-built images
  • Loading branch information
Arian04 committed Feb 14, 2024
1 parent 479ee54 commit 213f56a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5.1.0
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG BASE_IMAGE=python
ARG BASE_IMAGE_TAG=3.9.18-bullseye
#ARG BASE_IMAGE_TAG=3.9-bookworm # TODO: update base image to newer debian

##### Build Wheels #####
FROM $BASE_IMAGE:$BASE_IMAGE_TAG as builder_wheels
Expand Down
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
build:
docker_build:
docker build . -t ghcr.io/arian04/pytas:latest
run:
# This is a bad way to run an appplication honestly, but I'm working on improving it
xhost +SI:localuser:$(id -un)
docker run --rm --name PyTAS --ipc=host --user $(id -u):$(id -g) --volume=/tmp/.X11-unix/:/tmp/.X11-unix/ -e DISPLAY -e XAUTHORITY ghcr.io/arian04/pytas:latest
docker_run:
xhost +SI:localuser:$USER
docker run --rm --ipc=host --user $UID:$GID --volume=/tmp/.X11-unix/:/tmp/.X11-unix/ -e DISPLAY -e XAUTHORITY ghcr.io/arian04/pytas:latest
36 changes: 30 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
Run PyTAS through Docker
# Run PyTAS easily

## What is PyTAS?
Information about PyTAS can be found here: http://self-assembly.net/wiki/index.php/PyTAS

## What's the purpose of this repo?
I had a few issues running PyTAS. Firstly, it's a bit old. The newest Python version I could use to run
it was 3.9, which isn't too bad, but I also had to pin the dependencies to pretty old versions.
I wouldn't mind if that was all, but installing wxPython involved building wxWidgets, which not
only took a decent amount of time on my reasonably powerful system, it also repeatedly failed due to
missing build dependencies that wouldn't become satisfied even though I carefully made sure I had every
dependency required by the wxWidgets documentation. This repo is meant to help distribute it in a more
painless, portable manner.

## Methods of running

### Docker
I believe there are some negative security implications of this, but if you trust the image, then giving
it access to your X server should be fine.

```sh
# Make sure $USER is properly set in your user shell, and that $UID and $GID aren't set to root's values when you `sudo` a command

xhost +SI:localuser:$USER # allows your current local user to connect to the X server
sudo docker run --rm --ipc=host --user $UID:$GID --volume=/tmp/.X11-unix/:/tmp/.X11-unix/ -e DISPLAY -e XAUTHORITY ghcr.io/arian04/pytas:latest # runs the container in such a way that it can access the X server, deletes container on exit
```

TODO:

- add more methods of installation
- some method that just builds a static (ish) binary. maybe pyinstaller
- nix?
- add more methods of running
- Use Pyoxidizer to build a portable binary
- [nix](https://nixos.org/)?
- improve my current WIP method of running the GUI through Docker

Information about PyTAS can be found here: http://self-assembly.net/wiki/index.php/PyTAS
or just remove it if Pyoxidizer builds reliable binaries

0 comments on commit 213f56a

Please sign in to comment.