Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(server): remove docker-compose and cleanup #1484

Merged
merged 41 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
77015cb
Fix build
fortuna Jan 26, 2024
adb90b9
Replace docker with podman
fortuna Jan 27, 2024
fbce81e
Fix
fortuna Jan 27, 2024
6f5cd6d
Add periods
fortuna Jan 27, 2024
2caa4a1
Comments
fortuna Jan 27, 2024
e5fd24c
lint
fortuna Jan 27, 2024
39e9e71
Remove comment
fortuna Jan 27, 2024
defeb92
Fix integration
fortuna Jan 27, 2024
e312719
Try Buildah
fortuna Jan 27, 2024
1e1b2b0
fix buildah
fortuna Jan 27, 2024
6f35e5b
Update podman
fortuna Jan 27, 2024
7689d7d
Update requirements
fortuna Jan 27, 2024
29b1824
Use podman 4
fortuna Jan 27, 2024
eedb72b
Try
fortuna Jan 27, 2024
51c9710
Try
fortuna Jan 27, 2024
d6e85dd
Fix
fortuna Jan 27, 2024
b285a36
Disable cache
fortuna Jan 27, 2024
aef4e42
Actually disable cache
fortuna Jan 27, 2024
bc7ce27
Try new podman again
fortuna Jan 27, 2024
f42fdc6
Use alias
fortuna Jan 27, 2024
e2e6de9
Try again
fortuna Jan 27, 2024
e8ea635
Tweak
fortuna Jan 27, 2024
91f670d
Fix
fortuna Jan 27, 2024
62d29a7
|| true
fortuna Jan 27, 2024
e0f2577
Simplify util
fortuna Jan 27, 2024
1284b87
Use podman
fortuna Jan 27, 2024
4863a7c
Make test runnable directly
fortuna Jan 29, 2024
a0fcd80
Add README and cleanup
fortuna Jan 29, 2024
4faf5fd
Fix lint
fortuna Jan 29, 2024
ba6a792
Use docker
fortuna Jan 29, 2024
670c60a
Removed unused DOCKER_CONTENT_TRUST
fortuna Jan 29, 2024
67ffc21
Restore host names
fortuna Jan 29, 2024
893b8c7
Localhost
fortuna Jan 29, 2024
bf3fbe0
another localhost
fortuna Jan 29, 2024
dde9959
Unquote
fortuna Jan 29, 2024
26647b8
Update README
fortuna Jan 29, 2024
e922117
Update image name
fortuna Jan 29, 2024
8e6655e
More fix
fortuna Jan 29, 2024
c2d1e37
Fix
fortuna Jan 29, 2024
784a465
Rename
fortuna Jan 30, 2024
26e8098
Fix
fortuna Jan 30, 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
48 changes: 22 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"generate-license-file": "^1.2.0",
"husky": "^1.3.1",
"jasmine": "^3.5.0",
"minimist": "^1.2.8",
"prettier": "^2.4.1",
"pretty-quick": "^3.1.1",
"typescript": "^4.9.5"
Expand Down
3 changes: 1 addition & 2 deletions src/shadowbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ Shadowbox supports running on linux and macOS hosts.

Besides [Node](https://nodejs.org/en/download/) you will also need:

1. [Docker 1.13+](https://docs.docker.com/engine/installation/)
2. [docker-compose 1.11+](https://docs.docker.com/compose/install/)
1. [Podman 4+](https://podman-desktop.io/docs/installation)

### Running Shadowbox as a Node.js app

Expand Down
7 changes: 6 additions & 1 deletion src/shadowbox/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ WORKDIR /
# Don't copy node_modules and other things not needed for install.
COPY package.json package-lock.json ./
COPY src/shadowbox/package.json src/shadowbox/
# Enable cache when the Github action Ubuntu runner supports podman 4.
# RUN --mount=type=cache,target=/root/.npm npm ci
RUN npm ci

# We copy the source code only after npm ci, so that source code changes don't trigger re-installs.
Expand All @@ -46,8 +48,11 @@ LABEL shadowbox.node_version=16.18.0
ARG GITHUB_RELEASE
LABEL shadowbox.github.release="${GITHUB_RELEASE}"

# The user management service doesn't quit with SIGTERM.
STOPSIGNAL SIGKILL

# We use curl to detect the server's public IP. We need to use the --date option in `date` to
# safely grab the ip-to-country database
# safely grab the ip-to-country database.
RUN apk add --no-cache --upgrade coreutils curl

COPY src/shadowbox/scripts scripts/
Expand Down
8 changes: 3 additions & 5 deletions src/shadowbox/docker/build.action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ readonly NODE_IMAGE=$(
fi
)

# Doing an explicit `docker pull` of the container base image to work around an issue where
# Travis fails to pull the base image when using BuildKit. Seems to be related to:
# https://github.com/moby/buildkit/issues/606 and https://github.com/moby/buildkit/issues/1397
docker pull "${NODE_IMAGE}"
docker build --force-rm \
podman build --force-rm \
--os "linux" \
--arch "${ARCH}" \
--build-arg ARCH="${ARCH}" \
--build-arg NODE_IMAGE="${NODE_IMAGE}" \
--build-arg GITHUB_RELEASE="${TRAVIS_TAG:-none}" \
Expand Down
2 changes: 1 addition & 1 deletion src/shadowbox/docker/start.action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ if [[ "$(uname)" == "Darwin" ]]; then
NET_BINDINGS=(-p "${SB_API_PORT}:${SB_API_PORT}" -p "${ACCESS_KEY_PORT}:${ACCESS_KEY_PORT}" -p "${ACCESS_KEY_PORT}:${ACCESS_KEY_PORT}/udp")
fi;

docker run --rm -it "${NET_BINDINGS[@]}" --name shadowbox "${docker_bindings[@]}" "${IMAGE}"
podman run --rm -it "${NET_BINDINGS[@]}" --name shadowbox "${docker_bindings[@]}" "${IMAGE}"
2 changes: 1 addition & 1 deletion src/shadowbox/integration_test/client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1-alpine
FROM docker.io/golang:1-alpine

# curl for fetching pages using the local proxy
RUN apk add --no-cache curl git
Expand Down
60 changes: 0 additions & 60 deletions src/shadowbox/integration_test/docker-compose.yml

This file was deleted.

2 changes: 2 additions & 0 deletions src/shadowbox/integration_test/target/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@

# Pin to a known good signed image to avoid failures from the Docker notary service
FROM gcr.io/distroless/python3@sha256:58087520b3c929fe77e1ef3fc95062dbe80bbda265e0e7966c4997c71a9636ea
# The python SimpleHTTPServer doesn't quit with SIGTERM, so we use SIGKILL.
STOPSIGNAL SIGKILL
COPY index.html .
ENTRYPOINT ["python", "-m", "http.server", "80"]
Loading
Loading