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

xsnap without git #8537

Draft
wants to merge 6 commits into
base: release-getting-started
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ packages/stat-logger
**/swingset-kernel-state
**/_agstate
.vagrant

# When changing/adding entries here, make sure to search the whole project for
# `@@AGORIC_DOCKER_SUBMODULES@@`
#
# We avoid copying these into a docker build context, because we're
# also not copying the .git directories. If someone runs "docker
# build" from a non-clean agoric-sdk tree, the build context would
# have moddable/ source files but no moddable/.git, and that would be
# confused with an unpacked NPM tarball. See
# packages/xsnap/src/build.js for details.

packages/xsnap/moddable
packages/xsnap/xsnap-native
9 changes: 0 additions & 9 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ jobs:
run: echo "GIT_REVISION=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Save GIT_COMMIT
run: echo "GIT_COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Save commit hash, url of submodules to environment
run: |
node packages/xsnap/src/build.js --show-env >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
Expand Down Expand Up @@ -84,14 +81,8 @@ jobs:
platforms: ${{ matrix.platform }}
push: true
tags: '${{ env.REGISTRY }}/agoric/agoric-sdk:${{ env.BUILD_TAG }}'
# When changing/adding entries here, make sure to search the whole
# project for `@@AGORIC_DOCKER_SUBMODULES@@`
build-args: |
GIT_COMMIT=${{env.GIT_COMMIT}}
MODDABLE_COMMIT_HASH=${{env.MODDABLE_COMMIT_HASH}}
MODDABLE_URL=${{env.MODDABLE_URL}}
XSNAP_NATIVE_COMMIT_HASH=${{env.XSNAP_NATIVE_COMMIT_HASH}}
XSNAP_NATIVE_URL=${{env.XSNAP_NATIVE_URL}}
GIT_REVISION=${{env.GIT_REVISION}}
- name: Build and Push setup
uses: docker/build-push-action@v4
Expand Down
23 changes: 7 additions & 16 deletions packages/deployment/Dockerfile.sdk
Original file line number Diff line number Diff line change
Expand Up @@ -34,35 +34,26 @@ RUN set -eux; \
# The js build container
FROM node:18-bullseye AS build-js

# When changing/adding entries here, make sure to search the whole project for
# `@@AGORIC_DOCKER_SUBMODULES@@`
ARG MODDABLE_COMMIT_HASH
ARG MODDABLE_URL
ARG XSNAP_NATIVE_COMMIT_HASH
ARG XSNAP_NATIVE_URL

WORKDIR /usr/src/agoric-sdk
COPY . .

# add retry for qemu arm64 network fetching and mui issues with qemu
RUN bash -c "for i in {1..3}; do yarn install --network-timeout 1000000 && exit 0 || (echo retrying; sleep 15;) done; exit 1"
RUN \
XSNAP_IS_IN_DOCKER=1 \
bash -c "for i in {1..3}; do yarn install --network-timeout 1000000 && exit 0 || (echo retrying; sleep 15;) done; exit 1"

# Need to build the Node.js node extension that uses our above Golang shared library.
COPY --from=cosmos-go /usr/src/agoric-sdk/golang/cosmos/build golang/cosmos/build/
RUN cd golang/cosmos && yarn build:gyp

# Check out the specified submodule versions.
# When changing/adding entries here, make sure to search the whole project for
# `@@AGORIC_DOCKER_SUBMODULES@@`
# XSNAP_IS_IN_DOCKER tells xsnap that it needs to git-clone the
# submodules. See packages/xsnap/src/build.js for details
RUN \
MODDABLE_COMMIT_HASH="$MODDABLE_COMMIT_HASH" \
MODDABLE_URL="$MODDABLE_URL" \
XSNAP_NATIVE_COMMIT_HASH="$XSNAP_NATIVE_COMMIT_HASH" \
XSNAP_NATIVE_URL="$XSNAP_NATIVE_URL" \
XSNAP_IS_IN_DOCKER=1 \
yarn build

# Remove dev dependencies.
RUN rm -rf packages/xsnap/moddable packages/xsnap/xsnap-native/build/tmp
RUN rm -rf packages/xsnap/moddable packages/xsnap/xsnap-native/xsnap/build/tmp
# FIXME: This causes bundling differences. https://github.com/endojs/endo/issues/919
# RUN yarn install --frozen-lockfile --production --network-timeout 100000

Expand Down
3 changes: 1 addition & 2 deletions packages/deployment/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ docker-build: docker-build-sdk docker-build-solo \
docker-build-setup docker-build-ssh-node

docker-build-sdk:
bargs=`node ../xsnap/src/build.js --show-env | sed -e 's/^/ --build-arg=/'`; \
docker build $$bargs --build-arg=GIT_REVISION=$(GIT_REVISION) \
docker build --build-arg=GIT_REVISION=$(GIT_REVISION) \
-t $(REPOSITORY_SDK):$(TAG) --file=Dockerfile.sdk ../..
docker tag $(REPOSITORY_SDK):$(TAG) $(REPOSITORY_SDK):latest

Expand Down
4 changes: 0 additions & 4 deletions packages/xsnap/build.env

This file was deleted.

10 changes: 10 additions & 0 deletions packages/xsnap/build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"moddable": {
"url": "https://github.com/agoric-labs/moddable.git",
"hash": "f6c5951fc055e4ca592b9166b9ae3cbb9cca6bf0"
},
"xsnap_native": {
"url": "https://github.com/agoric-labs/xsnap-pub",
"hash": "2d8ccb76b8508e490d9e03972bb4c64f402d5135"
}
}
23 changes: 16 additions & 7 deletions packages/xsnap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
},
"scripts": {
"repl": "node src/xsrepl.js",
"build:bin": "if test -d ./test; then node src/build.js; else yarn build:from-env; fi",
"build:env": "test -d ./test && node src/build.js --show-env > build.env",
"build:from-env": "{ cat build.env; echo node src/build.js; } | xargs env",
"build": "yarn build:bin && yarn build:env",
"postinstall": "yarn build:from-env",
"build": "node src/build.js",
"postinstall": "yarn build",
"clean": "rm -rf xsnap-native/xsnap/build",
"lint": "run-s --continue-on-error lint:*",
"lint:js": "eslint 'src/**/*.js' 'test/**/*.js' api.js",
Expand Down Expand Up @@ -48,8 +45,20 @@
"files": [
"LICENSE*",
"api.js",
"build.env",
"src"
"build.json",
"src",
"moddable/licenses",
"moddable/readme.md",
"moddable/tools",
"moddable/xs",
"moddable/modules/data/text",
"moddable/modules/data/base64",
"xsnap-native/README.md",
"xsnap-native/xsnap/documentation",
"xsnap-native/xsnap/makefiles",
"xsnap-native/xsnap/readme.md",
"xsnap-native/xsnap/sources",
"xsnap-native/xsnap/xsbug-node"
],
"publishConfig": {
"access": "public"
Expand Down
Loading
Loading