Skip to content

Commit 2fd4f5f

Browse files
committed
Removed unused stuff, added GHA
1 parent 9cb825a commit 2fd4f5f

File tree

6 files changed

+95
-72
lines changed

6 files changed

+95
-72
lines changed

.github/workflows/build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
build:
11+
if: github.event.pull_request.draft == false
12+
runs-on: ubuntu-20.04
13+
steps:
14+
- name: "Get the latest code"
15+
uses: actions/checkout@v2
16+
- name: "Submodules"
17+
run: "git submodule update --init --recursive"
18+
- name: "Install requirements"
19+
run: "pip3 install -r requirements.txt"
20+
- name: "Run Black"
21+
run: "python3 -m black --check $(git ls-files '*.py')"
22+
- name: "Set up QEMU"
23+
uses: docker/setup-qemu-action@v1
24+
- name: "Set up Docker Buildx"
25+
uses: docker/setup-buildx-action@v1
26+
- name: "Build the sysroot container"
27+
id: docker_build
28+
uses: docker/build-push-action@v2
29+
with:
30+
push: false
31+
context: .
32+
file: docker/cpython.dockerfile
33+

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- name: "Get the code"
13+
uses: actions/checkout@v2
14+
- name: "Submodules"
15+
run: "git submodule update --init --recursive"
16+
- name: "Get tag version"
17+
run: echo ::set-env name=TAG_VERSION::${GITHUB_REF#refs/*/}
18+
- name: "Print tag version"
19+
run: echo ${{ env.TAG_VERSION }}
20+
- name: "Set up QEMU"
21+
uses: docker/setup-qemu-action@v1
22+
- name: "Set up Docker Buildx"
23+
uses: docker/setup-buildx-action@v1
24+
- name: "Log in to DockerHub"
25+
uses: docker/login-action@v1
26+
with:
27+
username: ${{ secrets.DOCKER_USERNAME }}
28+
password: ${{ secrets.DOCKER_PASSWORD }}
29+
- name: "Build and push sysroot container"
30+
id: docker_build
31+
uses: docker/build-push-action@v2
32+
with:
33+
push: true
34+
file: docker/cpython.dockerfile
35+
context: .
36+
tags: faasm/cpython:${{ env.TAG_VERSION }}

docker/cpython.dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
FROM faasm/sysroot:0.0.7
22

33
RUN apt install -y \
4-
libssl-dev
4+
libssl-dev \
5+
ninja-build
56

6-
WORKDIR cpython
7+
WORKDIR /code/faasm-cpython
78
COPY requirements.txt .
89
RUN pip3 install -r requirements.txt
910

11+
# Install build Python (careful with Docker cache here)
12+
COPY bin/install_build_python.sh bin/install_build_python.sh
13+
RUN ./bin/install_build_python.sh
1014

15+
# Add the rest of the code
1116
COPY . .
1217

13-
# Install build Python
14-
RUN ./bin/install_build_python.sh
18+
# Build CPython
19+
RUN inv cpython
1520

16-
# Install crossenv
21+
# Set up crossenv
1722
RUN ./bin/crossenv_setup.sh
1823

1924
# Build mxnet

tasks/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
from . import (
44
container,
55
cpython,
6+
git,
67
libs,
78
mxnet,
8-
ffi,
99
)
1010

1111
ns = Collection(
1212
container,
1313
cpython,
14+
git,
1415
libs,
1516
mxnet,
16-
ffi,
1717
)

tasks/ffi.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

tasks/git.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from invoke import task
2+
3+
from faasmtools.env import get_version, PROJ_ROOT
4+
from faasmtools.git import tag_project
5+
6+
7+
@task
8+
def tag(ctx):
9+
"""
10+
Creates git tag from the current tree
11+
"""
12+
version = get_version()
13+
tag_name = "v{}".format(version)
14+
tag_project(tag_name, PROJ_ROOT)

0 commit comments

Comments
 (0)