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

Full review #8

Merged
merged 17 commits into from
Sep 18, 2023
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
26 changes: 26 additions & 0 deletions .github/workflows/compile-and-run-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This is a workflow triggered by PR or triggered manually
# Runs quick performance tests and reports the comparison against HEAD
# Test should take less than 10 minutes to run on current self-hosted devices
name: "Compile and Run on x64"

# Controls when the action will run.
on:
push:

# Env variables
env:
SG_COMMIT: 2ab01ac
GITHUB_CONTEXT: ${{ toJson(github) }}

jobs:
Compile_and_Run_All:
name: Compile and run wasm-score benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: echo "$GITHUB_CONTEXT"
- run: |
# Create and Push Branch
./build.sh
docker run -i wasmscore /bin/bash wasmscore.sh
docker run -i wasmscore /bin/bash wasmscore.sh -t quickrun_all
49 changes: 49 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Contributor Covenant Code of Conduct

*Note*: this Code of Conduct pertains to individuals' behavior. Please also see the [Organizational Code of Conduct][OCoC].

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the Bytecode Alliance CoC team at [report@bytecodealliance.org](mailto:report@bytecodealliance.org). The CoC team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The CoC team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the Bytecode Alliance's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[OCoC]: https://github.com/bytecodealliance/wasmtime/blob/main/ORG_CODE_OF_CONDUCT.md
[homepage]: https://www.contributor-covenant.org
[version]: https://www.contributor-covenant.org/version/1/4/
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Contributing to WasmScore

Wasmscore is a [Bytecode Alliance] project. It follows the Bytecode
Alliance's [Code of Conduct] and [Organizational Code of Conduct].

For more information about contributing to this project you can consult the
[online documentation] which should cover all sorts of topics.

[Bytecode Alliance]: https://bytecodealliance.org/
[Code of Conduct]: CODE_OF_CONDUCT.md
[Organizational Code of Conduct]: ORG_CODE_OF_CONDUCT.md
[online documentation]: https://bytecodealliance.github.io/wasmtime/contributing.html
90 changes: 90 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
FROM ubuntu:20.04
ARG ARCH
ENV LD_LIBRARY_PATH=/usr/local/lib
ENV PATH=/usr/local/bin:$PATH
CMD ["/bin/bash"]
ENV DEBIAN_FRONTEND="noninteractive" TZ="America"
ARG RUST_VERSION="nightly-2023-04-01"
ARG WASMTIME_REPO="https://github.com/bytecodealliance/wasmtime/"
ARG WASMTIME_COMMIT="1bfe4b5" # v9.0.1
ARG SIGHTGLASS_REPO="https://github.com/bytecodealliance/sightglass.git"
ARG SIGHTGLASS_BRANCH="main"
ARG SIGHTGLASS_COMMIT="e89fce0"

# Get some prerequisites
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-utils build-essential gpg-agent \
curl ca-certificates wget software-properties-common \
psmisc lsof git nano zlib1g-dev libedit-dev time yasm \
libssl-dev pkg-config

# Bionic does not carry a recent enough cmake needed for wamr but upgrading
# to Focal causes other build issues so the straight forward solution is to just
# install a version of cmake that is recent enough from a separate repository
RUN wget -qO - https://apt.kitware.com/keys/kitware-archive-latest.asc | apt-key add -
RUN apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main'
RUN apt-get update && apt-get install --yes cmake

# Install wabt
WORKDIR /opt
RUN git clone --recurse-submodules https://github.com/WebAssembly/wabt.git \
&& cd wabt \
&& mkdir build \
&& cd build \
&& cmake .. \
&& cmake --build . \
&& make
ENV PATH=$PATH:/opt/wabt/bin/

# Install rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -sSf | sh -s -- --default-toolchain ${RUST_VERSION} -y
ENV PATH=/root/.cargo/bin:${PATH}

# Install clang
RUN apt-get install -y --no-install-recommends clang

# Install python
RUN apt-get install -y --no-install-recommends python3.8 libpython3.8 python3-distutils python3-pip
RUN python3 -m pip install termgraph \
&& python3 -m pip install pandas \
&& python3 -m pip install termcolor \
&& python3 -m pip install pyyaml

# Install sightglass
WORKDIR /
RUN git clone --recurse-submodules ${SIGHTGLASS_REPO} sightglass
WORKDIR /sightglass
RUN git checkout ${SIGHTGLASS_COMMIT} -b ${SIGHTGLASS_COMMIT}
COPY add_time_metric.diff /sightglass/add_time_metric.diff
RUN git apply add_time_metric.diff
RUN cargo build --release
RUN mkdir results

# Build wasmtime engine for sightglass
WORKDIR /
RUN git clone --recurse-submodule ${WASMTIME_REPO} wasmtime
WORKDIR /wasmtime
RUN git checkout ${WASMTIME_COMMIT} -b ${WASMTIME_COMMIT}
RUN git submodule update --init --recursive
RUN cargo build -p wasmtime-bench-api --release
RUN cp target/release/libwasmtime_bench_api.so /sightglass/engines/wasmtime/libengine.so

# Build native engine for sightglass
WORKDIR /sightglass/engines/native/libengine
RUN cargo build --release
RUN cp target/release/libnative_bench_api.so ../libengine.so

# Replace sightglass benchmarks folder with custom version
WORKDIR /
RUN rm -rf /sightglass/benchmarks
ADD benchmarks /sightglass/benchmarks

# Copy driver/helpers into the image
WORKDIR /
COPY wasmscore.py /sightglass/wasmscore.py
COPY wasmscore.sh /

# Set default entry and command
ENTRYPOINT ["/bin/bash", "/wasmscore.sh"]
CMD ["-t", "wasmscore"]
Loading