You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorial_binary_cache.rst
+10-7Lines changed: 10 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -177,9 +177,10 @@ For convenience you can also run ``spack buildcache push --update-index ...`` to
177
177
178
178
.. note::
179
179
180
-
As of Spack 0.22, build caches can be used across different Linux distros.
181
-
The concretizer will reuse specs that have a host compatible ``libc`` dependency (e.g. ``glibc`` or ``musl``).
182
-
For packages compiled with ``gcc`` (and a few others), users do not have to install compilers first, as the build cache contains the compiler runtime libraries as a separate package.
180
+
As of Spack 0.22, build caches can be used across different Linux distros. The concretizer
181
+
will reuse specs that have a host compatible ``libc`` dependency (e.g. ``glibc`` or ``musl``).
182
+
For packages compiled with ``gcc`` (and a few others), users do not have to install compilers
183
+
first, as the build cache contains the compiler runtime libraries as a separate package.
183
184
184
185
After an index is created, it's possible to list the available packages in the build cache:
185
186
@@ -247,7 +248,8 @@ Let's add a simple text editor like ``vim`` to our previous environment next to
247
248
248
249
.. note::
249
250
250
-
You may want to change ``mirrors::`` to ``mirrors:`` in the ``spack.yaml`` file to avoid a source build of ``vim`` --- but a source build should be quick.
251
+
You may want to change ``mirrors::`` to ``mirrors:`` in the ``spack.yaml`` file to avoid
252
+
a source build of ``vim`` --- but a source build should be quick.
251
253
252
254
.. code-block:: console
253
255
@@ -290,10 +292,11 @@ For those familiar with ``Dockerfile`` syntax, it would structurally look like t
290
292
This approach is still valid, and the ``spack containerize`` command continues to exist, but it has a few downsides:
291
293
292
294
* When ``RUN spack -e /root/env install`` fails, ``docker`` will not cache the layer, meaning
293
-
that all dependencies that did install successfully are lost.
294
-
Troubleshooting the build typically means starting from scratch in ``docker run`` or on the host system.
295
+
that all dependencies that did install successfully are lost. Troubleshooting the build
296
+
typically means starting from scratch in ``docker run`` or on the host system.
295
297
* In certain CI environments, it is not possible to use ``docker build``. For example, the
296
-
CI script itself may already run in a docker container, and running ``docker build`` *safely* inside a container is tricky.
298
+
CI script itself may already run in a docker container, and running ``docker build`` *safely*
299
+
inside a container is tricky.
297
300
298
301
The takeaway is that Spack decouples the steps that ``docker build`` combines: build isolation, running the build, and creating an image.
299
302
You can run ``spack install`` on your host machine or in a container, and run ``spack buildcache push`` separately to create an image.
0 commit comments