feat: teapot wrapper

This commit is contained in:
张泊明518370910136 2024-09-12 19:08:33 -04:00
parent 5db41b8728
commit 0a2e42ae7b
GPG Key ID: CA088E6D9284F870
4 changed files with 12 additions and 5 deletions

View File

@ -9,14 +9,14 @@ RUN apt-get update && \
userdel -r node && \
useradd -u 1000 -ms /bin/bash tt && \
useradd -u 1001 -ms /bin/bash student && \
echo "student ALL=(tt) NOPASSWD:/usr/local/bin/joj3" > /etc/sudoers.d/joj
echo "student ALL=(tt) NOPASSWD:/usr/local/bin/joj3\nstudent ALL=(tt) NOPASSWD:/usr/local/bin/joj3-teapot" > /etc/sudoers.d/joj
# install joint-teapot
# TODO: change it to FOCS gitea mirror for deployment
RUN pip install git+https://mirror.ghproxy.com/https://github.com/BoYanZh/Joint-Teapot --break-system-packages
# install joj3 binary
COPY bin/joj3 /usr/local/bin/
# install joj3 & teapot wrapper
COPY bin/joj3 bin/joj3-teapot /usr/local/bin/
USER student
WORKDIR /home/student

View File

@ -4,6 +4,7 @@ FOCS docker images used by [act_runner](https://gitea.com/gitea/act_runner) to r
Check <https://gitea.com/gitea/runner-images> for information about base images.
## `/bin` directory
## Quick Start
Put `joj3` binary in it.
1. Put `joj3` into `/bin`
2. `make build && make push` on a machine that can access `focs.ji.sjtu.edu.cn:5000`

View File

6
bin/joj3-teapot Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/bash
set -e
# TODO: real teapot commands
/usr/local/bin/joint-teapot --help