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: replace Python script with bash script for libwasm version detection #8078

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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: 2 additions & 7 deletions .github/workflows/build-wasm-simd-image-from-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,9 @@ jobs:
ref: "${{ env.GIT_TAG }}"
fetch-depth: 0

# TODO: #7885 Get rid of this script, it is super unecessary and can probably be done in the Dockerfile or a bash script
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: make python-install-deps
# Use bash script instead of Python script
- name: Get arguments
run: echo "LIBWASM_VERSION=$(scripts/get-libwasm-version.py --get-version)" >> $GITHUB_ENV
run: echo "LIBWASM_VERSION=$(bash scripts/get-libwasm-version.sh --get-version)" >> $GITHUB_ENV

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/e2e-test-workflow-call.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,16 @@ jobs:
- uses: actions/checkout@v4
if: ${{ inputs.build-and-push-docker-image-wasm }}

- uses: actions/setup-python@v5
- name: Set up Docker Buildx
if: ${{ inputs.build-and-push-docker-image-wasm }}
with:
python-version: '3.10'

- name: Install dependencies
if: ${{ inputs.build-and-push-docker-image-wasm }}
run: make python-install-deps
uses: docker/setup-buildx-action@v3

- name: Determine Build arguments
if: ${{ inputs.build-and-push-docker-image-wasm }}
id: build-args
run: |
echo "version=$(scripts/get-libwasm-version.py --get-version)" >> $GITHUB_OUTPUT
echo "checksum=$(scripts/get-libwasm-version.py --get-checksum)" >> $GITHUB_OUTPUT
echo "version=$(scripts/get-libwasm-version.sh --get-version)" >> $GITHUB_OUTPUT
echo "checksum=$(scripts/get-libwasm-version.sh --get-checksum)" >> $GITHUB_OUTPUT

- name: Log in to the Container registry
if: ${{ inputs.build-and-push-docker-image-wasm }}
Expand Down
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,6 @@ go.sum: go.mod
go mod verify
go mod tidy

#? python-install-deps: Install python dependencies
python-install-deps:
@echo "Installing python dependencies..."
@pip3 install --upgrade pip
@pip3 install -r requirements.txt

###############################################################################
### Documentation ###
###############################################################################
Expand Down
6 changes: 3 additions & 3 deletions scripts/build-wasm-simapp-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ set -eou pipefail
# build_wasm_image extracts the correct libwasm version and checksum
# based on the go.mod and builds a docker image with the provided tag.
function build_wasm_image(){
local version="$(scripts/get-libwasm-version.py --get-version)"
local checksum="$(scripts/get-libwasm-version.py --get-checksum)"
local version="$(scripts/get-libwasm-version.sh --get-version)"
local checksum="$(scripts/get-libwasm-version.sh --get-checksum)"
docker build . -t "${1}" -f modules/light-clients/08-wasm/Dockerfile --build-arg LIBWASM_VERSION=${version} --build-arg LIBWASM_CHECKSUM=${checksum}
}

# default to latest if no tag is specified.
TAG="${1:-ibc-go-wasm-simd:latest}"

build_wasm_image "${TAG}"
build_wasm_image "${TAG}"