Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/perf-nim' into perf-nim
Browse files Browse the repository at this point in the history
  • Loading branch information
lchenut committed Sep 29, 2023
2 parents 5cfd56d + 7b1f409 commit 473e013
Show file tree
Hide file tree
Showing 13 changed files with 24,139 additions and 1,383 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Interoperability/end to end test-plans & performance benchmarking for libp2p

[![Interop Dashboard](https://github.com/libp2p/test-plans/workflows/libp2p%20multidimensional%20interop%20test/badge.svg?branch=master)](https://github.com/libp2p/test-plans/actions/runs/6105882311/attempts/1#summary-16570044582)
[![Interop Dashboard](https://github.com/libp2p/test-plans/workflows/libp2p%20multidimensional%20interop%20test/badge.svg?branch=master)](https://github.com/libp2p/test-plans/actions/runs/6112109443/attempts/1#summary-16588854726)

[![Made by Protocol Labs](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://protocol.ai)

Expand Down
2 changes: 1 addition & 1 deletion multidim-interop/impl/js/v0.46/BrowserDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FROM mcr.microsoft.com/playwright


COPY --from=js-libp2p-base /app/ /app/
WORKDIR /app/interop
WORKDIR /app/node_modules/@libp2p/multidim-interop
# We install browsers here instead of the cached version so that we use the latest browsers at run time.
# Ideally this would also be pinned, but playwright controls this, so there isn't much we can do about it.
# By installing here, we avoid installing it at test time.
Expand Down
10 changes: 5 additions & 5 deletions multidim-interop/impl/js/v0.46/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Here because we want to fetch the node_modules within docker so that it's
# installed on the same platform the test is run. Otherwise tools like `esbuild` will fail to run
FROM node:18
FROM node:18.17.1
WORKDIR /app
COPY . .
RUN npm i && npm run build
RUN apt-get update && apt-get install -y cmake
COPY package*.json ./
RUN npm ci

WORKDIR /app/interop
RUN npm i && npm run build
WORKDIR /app/node_modules/@libp2p/multidim-interop

ENTRYPOINT [ "npm", "run", "test:interop:multidim", "--", "--build", "false", "--types", "false", "-t", "node" ]
22 changes: 12 additions & 10 deletions multidim-interop/impl/js/v0.46/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
image_name := js-v0.46
commitSha := b7e608998cc88860d9ec8a3ed7c03fdfb3eccb3b
image_name := js-v0.46.9

# TODO Enable webkit once https://github.com/libp2p/js-libp2p/pull/1627 is in
all: image.json chromium-image.json firefox-image.json
all: image.json chromium-image.json firefox-image.json update-lock-file

# Necessary because multistage builds require a docker image name rather than a digest to be used
load-image-json: image.json
Expand All @@ -18,17 +17,20 @@ firefox-image.json: load-image-json BrowserDockerfile
docker image inspect firefox-${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@

image.json: js-libp2p-${commitSha}
cd js-libp2p-${commitSha} && docker build -t ${image_name} -f ../Dockerfile .
# We update the lock file here so that we make sure we are always using the correct lock file.
# If this changes, CI will fail since there are unstaged changes.
update-lock-file: image.json
CONTAINER_ID=$$(docker create $$(jq -r .imageID image.json)); \
docker cp $$CONTAINER_ID:/app/package-lock.json ./package-lock.json; \
docker rm $$CONTAINER_ID

image.json:
docker build -t ${image_name} -f ./Dockerfile .
docker image inspect ${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@

js-libp2p-${commitSha}:
wget -O js-libp2p-${commitSha}.zip "https://github.com/libp2p/js-libp2p/archive/${commitSha}.zip"
unzip -o js-libp2p-${commitSha}.zip
unzip -o js-libp2p-${commitSha}.zip

clean:
rm -rf image.json js-libp2p-*.zip js-libp2p-* *-image.json
rm -rf image.json *-image.json

.PHONY: all clean browser-images load-image-json
Loading

0 comments on commit 473e013

Please sign in to comment.