Skip to content

Commit

Permalink
Add rust to binder configuration (Qiskit#7732)
Browse files Browse the repository at this point in the history
* Add rust to binder postBuild

In Qiskit#7658 we updated added rust code to the Qiskit build environment.
This was done to accelerate performance critical portions of the
library. However, in Qiskit#7658 we overlooked the binder tests which are used
to perform image comparisons for visualizations in a controlled
environment. The base binder docker image does not have the rust
compiler installed, so we need to manually install it prior to running
pip to install terra. This commit takes care of this and adds rust to
the binder environment.

* Install rust via conda for binder env

The binder image build is implicitly installing terra as it launches. So
trying to install rust manually as part of the postBuild script is too
late because it will have failed by then. Looking at the available
configuration files:

    https://mybinder.readthedocs.io/en/latest/config_files.html?#configuration-files

we can install conda packages defined in environment.yml as part of the
image build, and this will occur prior to the installation of terra.
This commit pivots to using the environment.yml to do this and we can
rely on the conda packaged version of rust instead of rustup.

* Move all binder files .binder/ dir

* Remove duplicate pip install in postBuild

* Revert "Remove duplicate pip install in postBuild"

This was actually needed, without this terra isn't actually installed.

This reverts commit d61c7a6.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
mtreinish and mergify[bot] authored Mar 4, 2022
1 parent 0be2c44 commit f08e647
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .binder/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: qiskit-terra-binder-test
channels:
- defaults
- conda-forge
dependencies:
- rust
- graphviz
- pip
File renamed without changes.

0 comments on commit f08e647

Please sign in to comment.