Skip to content

Usage Demo

Usage Demo #98

Workflow file for this run

##
## Copyright (c) 2022 TUM Department of Electrical and Computer Engineering.
##
## This file is part of MLonMCU.
## See https://github.com/tum-ei-eda/mlonmcu.git for further info.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
# ML on MCU demonstration (also serves as end-to-end testj
# TODO: provide docker image with apt packages
name: Usage Demo
on:
workflow_dispatch:
inputs:
template:
type: choice
description: Environment Template
options:
- default
- minimal
required: true
test:
type: boolean
description: Run long integration tests
required: true
artifact:
type: boolean
description: Upload artifacts
required: true
# push:
# branches:
# - main
# pull_request:
# branches:
# - main
jobs:
demo:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# TODO: caching
- name: Install APT packages
run: |
sudo apt -qq install -y g++ libboost-all-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev graphviz doxygen libtinfo-dev zlib1g-dev texinfo unzip device-tree-compiler
sudo apt -qq install -y ninja-build
sudo apt remove clang-11* llvm-11*
- name: Initialize Virtualenv
run: |
python -m pip install --upgrade pip
python -m venv .venv
- name: Install dependencies
run: |
source .venv/bin/activate
pip install -r requirements.txt
- name: Run package creation
run: |
source .venv/bin/activate
make install
- name: Initialize MLonMCU environment
run: |
source .venv/bin/activate
mlonmcu init home/ --non-interactive --template ${{ github.event.inputs.template }}
- name: Setup MLonMCU dependencies
run: |
source .venv/bin/activate
mlonmcu setup -H home/ -v
- name: Install environment-specific Python packages
run: |
source .venv/bin/activate
MLONMCU_HOME=$(pwd)/home/ mlonmcu setup -g
pip install -r home/requirements_addition.txt
- name: Run MLonMCU flow
run: |
source .venv/bin/activate
mlonmcu flow run sine_model -H home/ -v
mlonmcu export -H home/ session.zip
- name: Prepare complex integration tests (optional)
run: |
source .venv/bin/activate
pip install -r requirements_dev.txt
if: ${{ github.event.inputs.test == 'true' }}
- name: Run complex integration tests (optional)
run: |
source .venv/bin/activate
MLONMCU_HOME=$(pwd)/home/ make test-full
if: ${{ github.event.inputs.test == 'true' }}
- name: Remove dependencies (too large for artifact)
run: |
source .venv/bin/activate
mlonmcu cleanup -H home/ -f --deps
if: ${{ github.event.inputs.artifact == 'true' }}
- name: Archive environment (without deps)
uses: actions/upload-artifact@v2
with:
name: mlonmcu_home
path: home/
if: ${{ github.event.inputs.artifact == 'true' }}