Skip to content

Commit 2242562

Browse files
authored
Merge pull request easybuilders#260 from gkaf89/feature/run-local-instance
Add a section on how to run a development instance of EasyBuild
2 parents 5f14593 + 4732669 commit 2242562

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

docs/contributing.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,94 @@ git checkout develop
266266
git pull upstream develop
267267
```
268268

269+
##### Running your development instance {: #running_your_development_instance }
270+
271+
There are multiple ways to deploy a local development copy of EasyBuild. This
272+
section presents a method that is more relevant when modifying the framework and
273+
easyblock repositories.
274+
275+
To deploy a local copy of EasyBuild clone the
276+
[easybuild-framework](https://github.com/easybuilders/easybuild-framework),
277+
[easybuild-easyblocks](https://github.com/easybuilders/easybuild-easyblocks), and
278+
[easybuild-easyconfigs](https://github.com/easybuilders/easybuild-easyconfigs)
279+
repositories in the same directory, for instance a directory name `EasyBuild`.
280+
After cloning these repositories the content of the `EasyBuild` directory
281+
should be the following.
282+
283+
``` console
284+
$ tree -L 1 EasyBuild
285+
EasyBuild
286+
├── easybuild-easyblocks
287+
├── easybuild-easyconfigs
288+
└── easybuild-framework
289+
290+
3 directories, 0 files
291+
```
292+
293+
An environment variable with the path to the `EasyBuild` directory simplifies
294+
calls to the development instance of EasyBuild significantly; define this
295+
variable in the following manner.
296+
297+
``` shell
298+
export EB_DEVEL_ROOT=/path/to/EasyBuild
299+
```
300+
301+
To run the development instance, add the paths of the framework and easyblock
302+
repositories to the Python path, and the path of the easyconfig repository to
303+
the robot search path.
304+
305+
For instance, a command to install `ReFrame-4.3.3.eb` and its dependencies with
306+
the necessary variables defined for the command environment would be the
307+
following:
308+
309+
``` shell
310+
PYTHONPATH=${EB_DEVEL_ROOT}/easybuild-framework:${EB_DEVEL_ROOT}/easybuild-easyblocks:${PYTHONPATH} EASYBUILD_ROBOT_PATHS=${EB_DEVEL_ROOT}/easybuild-easyconfigs/easybuild/easyconfigs ${EB_DEVEL_ROOT}/easybuild-framework/eb --robot ReFrame-4.3.3.eb
311+
```
312+
313+
To avoid adding the variables in the environment of every single command while
314+
maintaining a clean shell environment, an alias can be defined as follows.
315+
316+
``` shell
317+
alias eb_devel='PYTHONPATH="${EB_DEVEL_ROOT}/easybuild-framework:${EB_DEVEL_ROOT}/easybuild-easyblocks:${PYTHONPATH}" EASYBUILD_ROBOT_PATHS="${EB_DEVEL_ROOT}/easybuild-easyconfigs/easybuild/easyconfigs" ${EB_DEVEL_ROOT}/easybuild-framework/eb'
318+
```
319+
320+
With the alias defined, the command to install `ReFrame-4.3.3.eb` and its
321+
dependencies now becomes the following:
322+
323+
``` shell
324+
eb_devel --robot ReFrame-4.3.3.eb
325+
```
326+
327+
??? note "Controlling the robot search path in development instances"
328+
329+
There is no default value for the [robot search
330+
path](/using-easybuild/#controlling_robot_search_path) in the development
331+
instance. The robot search path is set explicitly using the
332+
`EASYBUILD_ROBOT_PATHS` environment variable. As a result, expect that some
333+
features of the `EASYBUILD_ROBOT_PATHS` and its accompanying command line
334+
option, `--robot-paths` will not work with `eb_devel`, the alias for the
335+
EasyBuild development version.
336+
337+
For instance,
338+
339+
- you cannot use `EASYBUILD_ROBOT_PATHS` to set the robot path as it is
340+
overridden in the alias `eb_devel`, and
341+
- you cannot append to the default robot search path, with `--robot-paths`,
342+
as it overrides the `EASYBUILD_ROBOT_PATHS` environment option.
343+
344+
As a workaround,
345+
346+
- use `--robot-paths` to override the robot search path set via the alias, and
347+
- use the environment variable `EASYBUILD_ROBOT_PATHS` to access the
348+
the robot search path set by the alias so that you can append to it.
349+
350+
For instance to append to the development robot search path, use the
351+
following command.
352+
353+
``` shell
354+
eb_devel --robot-paths=${EASYBUILD_ROBOT_PATHS}:/path/to/dir_0:/path/to/dir_1 --robot ReFrame-4.3.3.eb
355+
```
356+
269357
### Opening a new pull request {: #contributing_creating_pull_requests }
270358

271359
!!! note

0 commit comments

Comments
 (0)