-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add constructor based installer #247
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Build installers | ||
|
||
on: | ||
workflow_call: | ||
|
||
permissions: | ||
contents: write | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
openlane-sky130a-installer: | ||
runs-on: "ubuntu-20.04" | ||
steps: | ||
- name: checkout conda-eda | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # fetch all tags | ||
|
||
- name: construct installer | ||
run: | | ||
export CI_SCRIPTS_PATH="$(pwd)/ci" | ||
./ci/install.sh | ||
conda install constructor | ||
constructor installer/openlane.sky130a/ | ||
|
||
- name: archive openlane.sky130a installer | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: "openlane-sky130a-installer" | ||
path: | | ||
/home/runner/work/conda-eda/conda-eda/openlane-sky130a-0-Linux-x86_64.sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't there any variable available with this path? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that would be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW I have no preference on the two. |
||
|
||
- run: | | ||
git config --local user.name conda-eda@bot | ||
git config --local user.email conda-eda@bot | ||
TAG=$(git describe --tags) | ||
git tag $TAG | ||
git push origin "HEAD:refs/tags/$TAG" | ||
echo "TAG=$TAG" >> $GITHUB_ENV | ||
Comment on lines
+39
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've just realized there are two issues here:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I did had this issue, and handled it by removing You're right it will overwrite the existing release with a new build even if there is no change in |
||
|
||
- uses: softprops/action-gh-release@v1 | ||
with: | ||
name: ${{ env.TAG }} | ||
tag_name: ${{ env.TAG }} | ||
files: | | ||
openlane-sky130a-installer/*.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: openlane-sky130a | ||
version: 0 | ||
|
||
channels: | ||
- https://conda.anaconda.org/litex-hub | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since all the constructor example were using fully qualified URLs: https://github.com/conda/constructor/search?q=conda.anaconda.org I assumed it was best-practice. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems channel names are enough for other channels than main indeed: https://github.com/restlessronin/lila-deep/blob/415fc7172c49e0a1ae766c7c9331d0d85645ef33/.colab/construct.yaml Though I found no |
||
- http://repo.anaconda.com/pkgs/main/ | ||
|
||
specs: | ||
- python 3.7* | ||
- conda | ||
- openlane | ||
- open_pdks.sky130a | ||
- xls | ||
|
||
post_install: post_install.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
cat >> $PREFIX/share/openlane/install/env.tcl <<EOF | ||
set ::env(PDK) "sky130A" | ||
set ::env(STD_CELL_LIBRARY) "sky130_fd_sc_hd" | ||
set ::env(STD_CELL_LIBRARY_OPT) "sky130_fd_sc_hd" | ||
EOF |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
|
||
# Identify OS | ||
UNAME_OUT="$(uname -s)" | ||
case "${UNAME_OUT}" in | ||
Linux*) OS=Linux;; | ||
*) OS="${UNAME_OUT}" | ||
echo "Unknown OS: ${OS}" | ||
exit;; | ||
esac | ||
|
||
mkdir -p $PREFIX/share/openlane | ||
git archive HEAD | tar -xv -C $PREFIX/share/openlane | ||
# define system and pdk variables | ||
mkdir -p $PREFIX/share/openlane/install | ||
cp -a $RECIPE_DIR/env.tcl $PREFIX/share/openlane/install | ||
mkdir -p $PREFIX/share/openlane/install/build/versions | ||
touch $PREFIX/share/openlane/install/build/versions/keep-directory | ||
# override default configuration to disable missing tools | ||
cp -a $RECIPE_DIR/disable-missing-tools.tcl $PREFIX/share/openlane/configuration/disable-missing-tools.tcl | ||
echo -n ' disable-missing-tools.tcl' >> $PREFIX/share/openlane/configuration/load_order.txt | ||
# add flow.tcl shortcut | ||
mkdir -p $PREFIX/bin | ||
cat > $PREFIX/bin/flow.tcl <<EOF | ||
#!/usr/bin/env tclsh | ||
lappend argv "-ignore_mismatches" | ||
source "$::env(CONDA_PREFIX)/share/openlane/flow.tcl" | ||
EOF | ||
chmod +x $PREFIX/bin/flow.tcl |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# https://github.com/hdl/conda-eda/issues/174 | ||
set ::env(RUN_CVC) 0 | ||
# https://github.com/The-OpenROAD-Project/OpenLane/issues/1380 | ||
set ::env(RUN_LVS) 0 | ||
# https://github.com/hdl/conda-eda/issues/175 | ||
set ::env(RUN_KLAYOUT) 0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# define system variables | ||
set ::env(OPENLANE_ROOT) "$::env(CONDA_PREFIX)/share/openlane" | ||
set ::env(OL_INSTALL_DIR) "$::env(CONDA_PREFIX)/share/openlane/install" | ||
set ::env(OPENLANE_LOCAL_INSTALL) 1 | ||
if { ! [info exists ::env(TCLLIBPATH)] } { | ||
set ::env(TCLLIBPATH) [glob -type d "/usr/share/tcltk/tcllib*"] | ||
} | ||
lappend ::auto_path $::env(TCLLIBPATH) | ||
# default to conda-install PDKs | ||
set ::env(PDK_ROOT) "$::env(CONDA_PREFIX)/share/pdk" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Use `conda-build-prepare` before building for a better version string. | ||
{% set version = '%s_%04i_%s'|format(GIT_DESCRIBE_TAG, GIT_DESCRIBE_NUMBER|int, GIT_DESCRIBE_HASH or 'gUNKNOWN') %} | ||
|
||
package: | ||
name: openlane | ||
version: {{ version }} | ||
|
||
source: | ||
git_url: https://github.com/The-OpenROAD-Project/OpenLane | ||
git_rev: master | ||
|
||
build: | ||
# number: 201803050325 | ||
number: {{ environ.get('DATE_NUM') }} | ||
# string: 20180305_0325 | ||
string: {{ environ.get('DATE_STR') }} | ||
script_env: | ||
- CI | ||
- CONDA_OUT | ||
- TEST_PACKAGE | ||
|
||
requirements: | ||
run: | ||
- openroad | ||
- magic | ||
- netgen | ||
- yosys | ||
- click | ||
- pyyaml | ||
|
||
test: | ||
requires: | ||
- open_pdks.sky130a | ||
commands: | ||
- PDK=sky130A STD_CELL_LIBRARY=sky130_fd_sc_hd STD_CELL_LIBRARY_OPT=sky130_fd_sc_hd flow.tcl -design inverter | ||
|
||
about: | ||
home: https://github.com/The-OpenROAD-Project/OpenLane | ||
license: Apache-2.0 | ||
license_family: Apache | ||
license_file: LICENSE | ||
summary: 'OpenLane is an automated RTL to GDSII flow.' | ||
description: | | ||
OpenLane is an automated RTL to GDSII flow based on several | ||
components including OpenROAD, Yosys, Magic, Netgen, CVC, | ||
SPEF-Extractor, KLayout and a number of custom scripts for design | ||
exploration and optimization. It also provides a number of custom | ||
scripts for design exploration, optimization and ECO. | ||
doc_url: https://openlane.readthedocs.io/ | ||
dev_url: https://github.com/The-OpenROAD-Project/OpenLane |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a separated workflow instead of an additional job in Build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually an additional
Job
inUpload
, see https://github.com/hdl/conda-eda/pull/247/files/4f827004e8068de55e99f6cdc7ad8f625ff07326..89a4136869d5488f40e5f7bcc0138e0ebb461638#diff-1ad29a53f212151bde5f56f9e784ef9ea58dbc5ba9df201cb0c26fa2c6116c87There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not the same. Construct is a new workflow, which is called as a reusable workflow from Upload. I mean having it as an additional job in workflow Build, without creating a new (reusable) workflow.
The Build workflow might be executed directly, not as a reusable workflow, which would ignore the recipes/jobs defined in Construct. However, if you put this job in Build, then it will always be run together with other recipes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point that it shouldn't be in fact run from
Upload
but fromBuild
. Perhaps you could move the Construct job then @proppy and useneeds: "openlane-linux"
for it? It'd be also nice to haveopenlane.sky130a
parametrized in Construct.yml so that it's reusable if we ever want to have more installers constructed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking that whe only want to "release" the installer when we actually publish the packages (so w/ that logic the same way we don't run
Upload
when we runBuild
independently, we couldn't runConstruct
).