From 006655f0f8fb35ed31f052d161a713bc4a5c6d9e Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Fri, 6 Oct 2023 20:05:48 +0800 Subject: [PATCH] let user build sdk-tester image --- tests/sdk_tests/Dockerfile | 52 --------------------- tests/sdk_tests/build-sdk-test-container.sh | 2 - tests/sdk_tests/docker-compose.yml | 2 +- tests/sdk_tests/entrypoint.sh | 3 -- tests/sdk_tests/run-tests.sh | 2 + 5 files changed, 3 insertions(+), 58 deletions(-) delete mode 100644 tests/sdk_tests/Dockerfile delete mode 100755 tests/sdk_tests/build-sdk-test-container.sh delete mode 100755 tests/sdk_tests/entrypoint.sh diff --git a/tests/sdk_tests/Dockerfile b/tests/sdk_tests/Dockerfile deleted file mode 100644 index fd9d6cc9..00000000 --- a/tests/sdk_tests/Dockerfile +++ /dev/null @@ -1,52 +0,0 @@ -# Originally from: https://github.com/devcontainers/images/blob/main/src/javascript-node/.devcontainer/Dockerfile -# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster -ARG VARIANT=16-bullseye -FROM node:${VARIANT} - -ARG USERNAME=node -ARG NPM_GLOBAL=/usr/local/share/npm-global - -# Add NPM global to PATH. -ENV PATH=${NPM_GLOBAL}/bin:${PATH} - -RUN \ - # Configure global npm install location, use group to adapt to UID/GID changes - if ! cat /etc/group | grep -e "^npm:" > /dev/null 2>&1; then groupadd -r npm; fi \ - && usermod -a -G npm ${USERNAME} \ - && umask 0002 \ - && mkdir -p ${NPM_GLOBAL} \ - && touch /usr/local/etc/npmrc \ - && chown ${USERNAME}:npm ${NPM_GLOBAL} /usr/local/etc/npmrc \ - && chmod g+s ${NPM_GLOBAL} \ - && npm config -g set prefix ${NPM_GLOBAL} \ - && su ${USERNAME} -c "npm config -g set prefix ${NPM_GLOBAL}" \ - # Install eslint - && su ${USERNAME} -c "umask 0002 && npm install -g eslint" \ - && npm cache clean --force > /dev/null 2>&1 - -# [Optional] Uncomment this section to install additional OS packages. -# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends - -# [Optional] Uncomment if you want to install an additional version of node using nvm -# ARG EXTRA_NODE_VERSION=10 -# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}" - -# [Optional] Uncomment if you want to install more global node modules -# RUN su node -c "npm install -g " - -WORKDIR / -COPY entrypoint.sh . -ENTRYPOINT ["/entrypoint.sh"] -# Placeholder CMD : generally this will be overridden at run time like : -# docker run -it -v /home/builder/cerc/laconic-sdk:/workspace cerc/builder-js sh -c 'cd /workspace && yarn && yarn build' -CMD node --version - -# Temp hack, clone the laconic-sdk repo here -WORKDIR /app -RUN \ - git clone https://github.com/cerc-io/laconic-sdk.git \ - && cd laconic-sdk \ - && yarn install - -WORKDIR /app/laconic-sdk diff --git a/tests/sdk_tests/build-sdk-test-container.sh b/tests/sdk_tests/build-sdk-test-container.sh deleted file mode 100755 index 69ff2a06..00000000 --- a/tests/sdk_tests/build-sdk-test-container.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -docker build -t cerc/laconic-sdk-tester:local-test . diff --git a/tests/sdk_tests/docker-compose.yml b/tests/sdk_tests/docker-compose.yml index b0788f9e..29b4530a 100644 --- a/tests/sdk_tests/docker-compose.yml +++ b/tests/sdk_tests/docker-compose.yml @@ -26,7 +26,7 @@ services: - "1317" sdk-test-runner: - image: cerc/laconic-sdk-tester:local-test + image: cerc/laconic-sdk-tester:local depends_on: laconicd: condition: service_healthy diff --git a/tests/sdk_tests/entrypoint.sh b/tests/sdk_tests/entrypoint.sh deleted file mode 100755 index 2bdf572b..00000000 --- a/tests/sdk_tests/entrypoint.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -exec "$@" - diff --git a/tests/sdk_tests/run-tests.sh b/tests/sdk_tests/run-tests.sh index acf630e7..8ad8bf7f 100755 --- a/tests/sdk_tests/run-tests.sh +++ b/tests/sdk_tests/run-tests.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# Forwards all args to yarn on the sdk-test-runner container + if [ -n "$CERC_SCRIPT_DEBUG" ]; then set -x fi