forked from PiSCSI/piscsi
-
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.
Run web API test suite in GitHub Actions (PiSCSI#1009)
- Fixed ignore patterns in .dockerignore - Added healthchecks to backend and web containers - Reduced Docker image sizes - Removed RaSCSI references in various areas (e.g. rascsi -> backend) - Added compilation-only step to easyinstall.sh - Moved apt package lists to variables - Revert to triggering GitHub Actions runs on push - Updated web/frontend_checks workflow to run black and flake8 against all Python sources - Capture log files from backend/web containers - Fix None to float conversion bug when user agent is absent or unrecognised
- Loading branch information
1 parent
eca8145
commit 88ff542
Showing
30 changed files
with
462 additions
and
227 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
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
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
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
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,36 @@ | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
FROM debian:bullseye AS build | ||
RUN apt-get update && apt-get install --assume-yes --no-install-recommends sudo | ||
RUN groupadd pi \ | ||
&& useradd --create-home --shell /bin/bash -g pi pi \ | ||
&& echo "pi ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | ||
|
||
USER pi | ||
WORKDIR /home/pi/RASCSI | ||
|
||
COPY --chown=pi:pi easyinstall.sh . | ||
COPY --chown=pi:pi cpp cpp | ||
COPY --chown=pi:pi doc doc | ||
RUN ./easyinstall.sh --run_choice=15 --cores=`nproc` | ||
|
||
FROM debian:bullseye-slim AS runner | ||
USER root | ||
WORKDIR /home/pi | ||
|
||
COPY --from=build /home/pi/RASCSI/cpp/bin/fullspec/* /usr/local/bin/ | ||
COPY docker/backend/rascsi_wrapper.sh /usr/local/bin/rascsi_wrapper.sh | ||
RUN chmod +x /usr/local/bin/* | ||
RUN mkdir -p /home/pi/images | ||
|
||
RUN apt-get update \ | ||
&& apt-get install --no-install-recommends --assume-yes libpcap-dev libprotobuf-dev \ | ||
&& apt autoremove -y \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
EXPOSE 6868 | ||
ENTRYPOINT ["/usr/local/bin/rascsi_wrapper.sh", "-r", "7", "-F", "/home/pi/images"] | ||
CMD ["-L", "trace"] | ||
|
||
HEALTHCHECK --interval=5m --timeout=1s CMD rasctl -v |
File renamed without changes.
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,42 @@ | ||
services: | ||
backend: | ||
image: ${DOCKER_BACKEND_IMAGE} | ||
build: | ||
context: .. | ||
dockerfile: docker/backend/Dockerfile | ||
init: true | ||
volumes: | ||
- ./volumes/images:/home/pi/images:delegated | ||
healthcheck: | ||
interval: 5s | ||
start_period: 5s | ||
|
||
web: | ||
build: | ||
context: .. | ||
dockerfile: docker/web/Dockerfile | ||
args: | ||
- OS_VERSION=buster | ||
volumes: | ||
- ./volumes/images:/home/pi/images:delegated | ||
init: true | ||
command: ["--rascsi-host=backend", "--log-level=debug"] | ||
healthcheck: | ||
interval: 5s | ||
start_period: 5s | ||
|
||
pytest: | ||
depends_on: | ||
web: | ||
condition: service_healthy | ||
backend: | ||
condition: service_healthy | ||
profiles: | ||
- webui-tests | ||
build: | ||
context: .. | ||
dockerfile: docker/pytest/Dockerfile | ||
working_dir: /src | ||
volumes: | ||
- ./volumes/pytest:/src/tests/output:delegated | ||
command: ["-vv"] |
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,4 +1,7 @@ | ||
services: | ||
rascsi_web: | ||
web: | ||
volumes: | ||
- ../python:/home/pi/RASCSI/python:delegated | ||
pytest: | ||
volumes: | ||
- ../python/web:/src:delegated |
Oops, something went wrong.