Skip to content

Commit

Permalink
Merge pull request #288 from ChrisCummins/release-v0.1.9
Browse files Browse the repository at this point in the history
Release v0.1.9
  • Loading branch information
ChrisCummins authored Jun 3, 2021
2 parents e53ad52 + 1584b28 commit ba182a4
Show file tree
Hide file tree
Showing 205 changed files with 8,778 additions and 6,269 deletions.
28 changes: 28 additions & 0 deletions .github/actions/install-build-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Install the Linux dependencies
description: Install build dependencies
runs:
using: composite
steps:
- name: Install dependencies (linux)
run: |
if [ "$(uname)" != "Darwin" ]; then
curl -L "https://github.com/bazelbuild/bazelisk/releases/download/v1.6.1/bazelisk-linux-amd64" > bazel
chmod +x bazel
sudo mv bazel /usr/local/bin/bazel
sudo apt-get install clang-9 patchelf
python -m pip install -r compiler_gym/requirements.txt -r examples/requirements.txt -r tests/requirements.txt
fi
shell: bash

- name: Install dependencies (macos)
run: |
if [ "$(uname)" = "Darwin" ]; then
brew install bazelisk zlib
python -m pip install -r compiler_gym/requirements.txt -r examples/requirements.txt -r tests/requirements.txt
fi
shell: bash
env:
LDFLAGS: -L/usr/local/opt/zlib/lib
CPPFLAGS: -I/usr/local/opt/zlib/include
PKG_CONFIG_PATH: /usr/local/opt/zlib/lib/pkgconfig
69 changes: 8 additions & 61 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python: [3.6, 3.7, 3.8, 3.9]
exclude:
# Only test recent python versions on macOS.
- os: macos-latest
python: 3.6
- os: macos-latest
python: 3.7
python: [3.9]

steps:
- uses: actions/checkout@v2
Expand All @@ -34,41 +28,25 @@ jobs:
with:
python-version: ${{ matrix.python }}

- name: Install dependencies (linux)
run: |
curl -L "https://github.com/bazelbuild/bazelisk/releases/download/v1.6.1/bazelisk-linux-amd64" > bazel
chmod +x bazel
sudo mv bazel /usr/local/bin/bazel
sudo apt install clang-9 patchelf
python -m pip install -r compiler_gym/requirements.txt -r examples/requirements.txt -r tests/requirements.txt
if: matrix.os == 'ubuntu-latest'

- name: Install dependencies (macOS)
run: |
brew install bazelisk zlib
python -m pip install -r compiler_gym/requirements.txt -r examples/requirements.txt -r tests/requirements.txt
env:
LDFLAGS: -L/usr/local/opt/zlib/lib
CPPFLAGS: -I/usr/local/opt/zlib/include
PKG_CONFIG_PATH: /usr/local/opt/zlib/lib/pkgconfig
if: matrix.os == 'macos-latest'
- name: Install build dependencies
uses: ./.github/actions/install-build-dependencies

- name: Test
run: make test
env:
CC: clang
CXX: clang++
BAZEL_OPTS: --batch
BAZEL_TEST_OPTS: --config=ci --test_timeout=300,900,1800,7200


install_test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python: [3.8]
python: [3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
Expand All @@ -78,53 +56,22 @@ jobs:
with:
python-version: ${{ matrix.python }}

- name: Install dependencies (linux)
run: |
curl -L "https://github.com/bazelbuild/bazelisk/releases/download/v1.6.1/bazelisk-linux-amd64" > bazel
chmod +x bazel
sudo mv bazel /usr/local/bin/bazel
sudo apt install clang-9 patchelf
python -m pip install -r compiler_gym/requirements.txt -r examples/requirements.txt -r tests/requirements.txt
if: matrix.os == 'ubuntu-latest'

- name: Install dependencies (macos)
run: |
brew install bazelisk zlib
python -m pip install -r compiler_gym/requirements.txt -r examples/requirements.txt -r tests/requirements.txt
env:
LDFLAGS: -L/usr/local/opt/zlib/lib
CPPFLAGS: -I/usr/local/opt/zlib/include
PKG_CONFIG_PATH: /usr/local/opt/zlib/lib/pkgconfig
if: matrix.os == 'macos-latest'
- name: Install build dependencies
uses: ./.github/actions/install-build-dependencies

- name: Install
run: make install
env:
CC: clang
CXX: clang++
BAZEL_OPTS: --batch
BAZEL_BUILD_OPTS: --config=ci

- name: Test
run: make install-test
env:
CC: clang
CXX: clang++
BAZEL_BUILD_OPTS: --config=ci
if: matrix.os == 'macos-latest'

- name: Test with coverage
run: make install-test-cov
env:
CC: clang
CXX: clang++
BAZEL_BUILD_OPTS: --config=ci
if: matrix.os == 'ubuntu-latest'

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
files: ./coverage.xml
if: matrix.os == 'ubuntu-latest'

- name: Uninstall
run: make purge
46 changes: 46 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: Test Coverage

on:
push:
branches:
- development
- stable
pull_request:

jobs:
pytest-cov:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install build dependencies
uses: ./.github/actions/install-build-dependencies

- name: Install
run: make install
env:
CC: clang
CXX: clang++
BAZEL_OPTS: --batch
BAZEL_BUILD_OPTS: --config=ci

- name: Test
# Note the `|| true` as we don't care about failing tests in this
# job.
run: make install-test-cov || true
env:
CC: clang
CXX: clang++

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
files: ./coverage.xml
if: ${{ always() }}
21 changes: 5 additions & 16 deletions .github/workflows/fuzz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- cron: 0 9 * * 1-5 # every weekday at 9am

jobs:
test:
fuzz:
runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -30,27 +30,16 @@ jobs:
with:
python-version: ${{ matrix.python }}

- name: Install build dependencies (linux)
run: |
curl -L "https://github.com/bazelbuild/bazelisk/releases/download/v1.6.1/bazelisk-linux-amd64" > bazel.tmp
sudo mv bazel.tmp /usr/local/bin/bazel
chmod +x /usr/local/bin/bazel
sudo apt install clang-9 patchelf
python -m pip install -r compiler_gym/requirements.txt -r tests/requirements.txt
if: matrix.os == 'ubuntu-latest'

- name: Install build dependencies (macOS)
run: |
brew install bazelisk
python -m pip install -r compiler_gym/requirements.txt -r tests/requirements.txt
if: matrix.os == 'macos-latest'
- name: Install build dependencies
uses: ./.github/actions/install-build-dependencies

- name: Install
run: make install
env:
CC: clang
CXX: clang++
BAZEL_OPTS: --batch
BAZEL_TEST_OPTS: --config=ci

- name: Test
run: FUZZ_TIME=600 make fuzz
run: FUZZ_TIME=600 make install-fuzz
9 changes: 8 additions & 1 deletion .github/workflows/pre_commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,33 @@ jobs:
sudo rm -f /usr/bin/clang-format
sudo ln -s /usr/bin/clang-format-10 /usr/bin/clang-format
clang-format --version
- name: Install go
uses: actions/setup-go@v2
with:
go-version: ^1.13.1

- name: Install buildifier
run: |
go get github.com/bazelbuild/buildtools/buildifier
buildifier --version
- name: Install prototool
run: |
GO111MODULE=on go get github.com/uber/prototool/cmd/prototool@dev
prototool version
- name: Install hadolint
run: |
wget -O hadolint https://github.com/hadolint/hadolint/releases/download/v1.19.0/hadolint-Linux-x86_64
chmod +x hadolint
sudo mv hadolint /usr/local/bin
- name: Install Python 3.9
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install Python dependencies
run: |
sudo apt-get install python3-setuptools
Expand All @@ -51,6 +57,7 @@ jobs:
python3 -m isort --version
python3 -m black --version
python3 -m pre_commit --version
- name: Run pre-commit checks
# TODO(github.com/facebookresearch/CompilerGym/issues/1): Disable
# isort due to inconsistent results when run locally versus in
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/release_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python: [3.9]
python: [3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
Expand All @@ -26,8 +26,16 @@ jobs:
with:
python-version: ${{ matrix.python }}

- name: Install runtime dependencies (macos)
run: brew install zlib
if: matrix.os == 'macos-latest'

- name: Install python wheel
run: python -m pip install compiler_gym
env:
LDFLAGS: -L/usr/local/opt/zlib/lib
CPPFLAGS: -I/usr/local/opt/zlib/include
PKG_CONFIG_PATH: /usr/local/opt/zlib/lib/pkgconfig

- name: Install python test dependencies
run: python -m pip install -r tests/requirements.txt
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/sanitizers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: LLVM Sanitizers

on:
push:
branches:
- development
- stable
pull_request:

jobs:
llvm-service-asan:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install build dependencies
uses: ./.github/actions/install-build-dependencies

- name: Build pip package
run: make bazel-build
env:
CC: clang
CXX: clang++
BAZEL_OPTS: --batch
BAZEL_BUILD_OPTS: --config=ci

- name: Build address sanitized LLVM compiler service
run: make bazel-build BAZEL_BUILD_OPTS=--config=asan BUILD_TARGET=//compiler_gym/envs/llvm/service:compiler_gym-llvm-service
env:
CC: clang
CXX: clang++
BAZEL_OPTS: --batch
BAZEL_BUILD_OPTS: --config=ci

- name: Install pip package
run: make pip-install

- name: Test
run: make install-test TEST_TARGET=tests/llvm
env:
ASAN_OPTIONS: detect_leaks=1
CC: clang
CXX: clang++
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#
# $ pre-commit run --all-files
#
# Install the pre-commit hook using:
# The pre-commit git hook is installed using:
#
# $ pre-commit install
# $ make init
#
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ py_library(
"//compiler_gym/datasets",
"//compiler_gym/envs",
"//compiler_gym/service",
"//compiler_gym/service/runtime",
"//compiler_gym/spaces",
"//compiler_gym/views",
"//examples/sensitivity_analysis:action_sensitivity_analysis",
Expand Down
Loading

0 comments on commit ba182a4

Please sign in to comment.