-
Notifications
You must be signed in to change notification settings - Fork 48
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
Simplify installation procedure #564
Comments
This is related to using the deprecated wrappers vs using the
This is not a requirement. That's one solution for installing all the required tools. There are other approaches: https://github.com/hdl/packages. The procedure for installing f4pga itself, assuming that tools are available in the PATH, and using the new flows only, is just calling pip once.
See previous point.
#556.
If the environments from arch-defs or the updated guidelines from examples are used (see chipsalliance/f4pga-examples#306), installing f4pga manually/explicitly is not required. Some users might want to do it, though. It depends on how they want to install the tools/environment.
If any dependency is missing, that's a packaging issue that we should solve by adding it to https://github.com/chipsalliance/f4pga/blob/main/f4pga/requirements.txt. Setting F4PGA_INSTALL_DIR can be managed as a CLI option or as an option in the configuration file. Moreover, we might reconsider including f4pga-env in the arch-defs packages, which would allow us to get rid of all the envvars. With regard to the conda environment itself, I refer to the comment above.
This is similar to #561 (comment). So: wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O conda_installer.sh
# Process the devices arg to decide the family?
export FPGA_FAM=xc7
bash conda_installer.sh -u -b -p $ARG_PATH/$FPGA_FAM/conda;
source "$ARG_PATH/$FPGA_FAM/conda/etc/profile.d/conda.sh";
# Which environment to use if not from arch-defs or f4pga-examples?
conda env create -f $FPGA_FAM/environment.yml
for PKG in install $ARG_DEVICES; do
wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/20220406-185509/symbiflow-arch-defs-${PKG}-3ef4188.tar.xz | tar -xJC $ARG_PATH/xc7/install
done
export PATH="$ARG_PATH/$FPGA_FAM/install/bin:$PATH"
conda activate xc7 Overall, I do understand the motivation. However, see #561 (comment).
I don't understand this comment. The tdm (arch-defs packages manager) should only take care of downloading and extracting tarballs in certain locations. It should not care about environments. |
The original, STDM does not even download packages and I don't think there's a clear guideline on the scope of what TDM should do (altough it could be understood intuitively that it should be used for downloading stuff). I do, however agree, that it shouldn't be responsible for installing anything. At no point I suggested that TDM should be used to install stuff. I did however attempt to install f4pga using the resources contained in artifacts (which were downloaded using a version of TDM that's included in my fork, but that's besides the point). The install artifact contains
Correct me if I'm wrong, but that's the only solution mentioned in the docs that's not targeted towards people who want to develop arch-defs. The fact that I could install all the tools manually (assuming I'm familiar with the entire tech stack used by f4pga, which might not be the case for newcomers), use other repos, etc. doesn't make the whole process more straight-forward.
I'm pretty sure that this can be solved by generating
Not sure where it's used, but it looks useful for improving installation procedure. On the other hand, how hard would it be to make these paths follow a uniform scheme?
This PR is in a draft state and seems to be related to f4pga-examples. One the points I'm trying to make is that the installation process should be be made easy without relying on the the examples or arch-defs repo.
Tuttest shouldn't be an issue if you have a working stand-alone script that you can reference in a code-block within a tutorial. I also realize that managing conda environments might be tricky and conda will complain about not being initialized for a given shell when it's not explicitly ran by the end-user. I don't know how this could be handled correctly at the moment. My suggestion, however would be to at least separate conda installation procedure from the rest (creating environment, setting environmental variables, etc). in getting started docs. Maybe just list it as a prerequisite for using F4PGA. It's confusing to read the instructions when you already have conda installed on your system. |
Fair enough. Yet, note the description of SymbiFlow/symbiflow-tools-data-manager: "Python based package manager to get packages and artifacts of symbiflow projects". See also olofk/pdk-config.py.
I believe we need to agree on clarifying the terminology, because this is going to be confusing for us and for users. When you say "attempt to install f4pga" do you mean the same as with "how to install F4PGA"? Do you use the lowercase to refer to the Python package and the uppercase to the whole environment (collection of tools)? We might use pyfpga to refer to the Python package. Overall, the f4pga Python package does not need to be installed inside the conda environment. It is recommended to always use pip inside a Python virtual environment, and Conda is a particular type of such environment. Therefore, it is sensible to install the f4pga Python package inside Conda. However, it is not a requirement. Ideally, the f4pga CLI would be able to interact with tools installed using various procedures (see issues 15, 16 an 17 from SymbiFlow/make-env). E.g. Anyway, your comments about the
That depends on the scope. If we focus on the F4PGA repositories, that is correct (see chipsalliance/f4pga-examples#227). However, there are other people in the broader community providing alternatives. Edalize is one of them (see f4pga/ideas#66, https://github.com/f4pga/ideas/blob/main/gsoc-2022-ideas.md#f4pga-toolchain-integration-in-mainline-edalize and https://github.com/f4pga/ideas/blob/main/gsoc-2022-ideas.md#generalization-of-wrapper-scripts-for-installed-f4pga-toolchain-and-making-them-OS-agnostic), which supports using the containers built in hdl/containers. See comments below about the "Getting started" section.
That is correct. However, the whole idea is that you don't need to do it manually; someone else does it for you. Typically, that role is the one of "package" and "distribution" maintainers. Conda is one package management and distribution solution, but there are many other. Most system package managers do handle "groups" of utilities. For instance, on MSYS2, group mingw-w64-x86_64-eda allows installing ~20 tools at once. On Fedora, there is coprs/rezso/HDL (see hdl/containers#41).
Which, in the context of F4PGA, is pretty similar to how most users expect to use Conda. NOTE: Conda containers will break when chipsalliance/f4pga-examples#306 is merged, and I will need to fix the recipe. NOTE: As discussed in olofk/edalize#299, because of the size of arch-defs packages, @olofk was considering to use the container with the "install" package only, and then "dynamically" fetch the arch-defs packages for the desired architectures, keeping some kind of cache. I believe that's the context of olofk/pdk-config.py.
If you mean adding it to f4pga-examples, I refer to #561 (comment). I am not aware of the criteria that lead to writing the commands one-by-one in the f4pga-examples documentation and then running them through tuttest. I can only guess... the purpose was to force the users to write/copy the commands and take care while doing so, which is a typical strategy for learning. I agree it does make sense to gather all the content of https://f4pga-examples.readthedocs.io/en/latest/getting.html in a single shell script which users can fetch and execute with a few options. However, that'd be less friendly to the very less experienced users (comments in shell VS a website). On the other hand, I would not recommend duplicating the guidelines (having the step-by-step tuttest approach in parallel to an all-in-one shell script); I'd neither oppose as long as both solutions are tested in CI. If you mean adding it to this repo, see comments below about https://github.com/chipsalliance/f4pga/tree/main/.github/scripts.
That is correct. The only exports needed before and during the installation are INSTALL_DIR and F4PGA_FAM. However, we should change INSTALL_DIR to F4PGA_INSTALL_DIR as soon as possible, and let the same envvar be used during the installation and by the
It is not used at the moment. See 80748d7 and fbf7a4d. See also log of the Apr 19 meeting. Nevertheless, Overall, for now I think we'd better go with enhancing
The draft state was due to hardware-ci needing a fix. I wanted to point out the addition of f4pga to the requirements file (https://github.com/chipsalliance/f4pga-examples/pull/306/files#diff-b0fc49199a26dad2e2805f182532239409c487a34c30124bb6aeb39c43fefbda), as a reply to "installing local package through PIP". Anyway, I agree it would be interesting to have guidelines for intermediate users about how to get the flows running faster. Maybe the documentation of this repo is the place for such content? We can have a reduced set of tests/examples with a simplified environment and a couple of shell scripts. In the end, f4pga-examples is focused on testing many examples on many platforms, and arch-defs is for developing the packages.
This is something I have in my notes for enhancing https://f4pga.readthedocs.io/en/latest/getting-started.html:
Note that https://github.com/chipsalliance/f4pga/blob/main/.github/scripts/activate.sh is rather close to the |
Closing as completed in #588. Pending issues, such as the pdk-config/stdm or using containers through an Action, will be dealt with in follow-up issues/PRs. |
The installation procedure is way too convoluted at the moment.
It involves:
Then, to use the python wrappers one must enter the right conda environemnt (this will probably remain probably inevitable for quite a long time), set
F4PGA_INSTALL_DIR
and hope there are no missing dependecies (likeclick
).How IMO it should work:
Download an
install
bash script.Run the script, eg.:
The script updates conda environment and installs pip packages, including f4pga
The script downloads artifacts required for requested platforms.
The script exports
settings.sh
file with environmental variables to source in order to use f4pga.Note that the management of artifacts could be done as a part of f4pga through modified (s)tdm.
See https://github.com/antmicro/f4pga/blob/f4pga-installer/f4pga/common/tdm.py, https://github.com/antmicro/f4pga/blob/f4pga-installer/f4pga/installer/__init__.py
This is related to #556
(note, this doesn't exactly work as intended because it uses environment.yml provided within packages which is invalid - currently we need to use one from f4pga-examples).
The text was updated successfully, but these errors were encountered: