Skip to content

Commit 30a94d6

Browse files
committed
Merge branch 'master' of ssh://github.com/KarrLab/intro_to_wc_modeling
2 parents 212b11d + a4e89ce commit 30a94d6

File tree

5 files changed

+39
-24
lines changed

5 files changed

+39
-24
lines changed

docs/concepts_skills/linux/building_linux_containers.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
.. _building_linux_containers:
2-
31
How to build a Ubuntu Linux image with Docker
4-
=================================================
2+
=============================================
53
Docker images are configurable, free-standing computing environments that can be used to create and run custom software on top of an operating system. Unlike virtual machines (VM), images do not contain an operating system. Docker images are a convenient way to distribute complicated software programs that have numerous dependencies and complicated configurations. We are using Docker images because CircleCI allows users to use Docker images to customize the environment used to execute each build. This makes it much easier to install programs into the environment used by CircleCI to run our builds.
64

75
Docker images are built by compiling Dockerfiles which are explicit instructions on how to build the image. Importantly, this makes Docker images very transparent.

docs/concepts_skills/software_engineering/continuous_integration.rst

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ Follow these instructions to use CircleCI to continuously test a GitHub reposito
3737
#. Click the `Follow Project` button for any repository you want to compile and test on CircleCI
3838
#. Add a CircleCI configuration file, ``/path/to/repo/.circleci/config.yml``, to the repository to instruct CircleCI what to execute within each build. This includes the following instructions
3939

40-
* Which container/virtual machine should be used to run the build. We are using a custom container so that little additional software needs to be installed to test our code. See :numref:`building_linux_containers` for more information about how to create and use custom Linux containers.
40+
See :ref:`Using the CircleCI cloud-based continuous integration system` please.
41+
42+
* Which container/virtual machine should be used to run the build. We are using a custom container so that little additional software needs to be installed to test our code. See :ref:`How to build a Ubuntu Linux image with Docker` for more information about how to create and use custom Linux containers.
4143
* Which GitHub repository to checkout.
4244
* How to install any additional packages needed to execute the tests.
4345
* Instructions on how to run the tests and store the results.
@@ -75,15 +77,23 @@ There are two main mechanisms to decrease the runtime of CircleCI builds by load
7577

7678
The Dockerfile for the Docker image that the Karr Lab uses with CircleCI is located at `https://github.com/KarrLab/karr_lab_docker_images/tree/master/build <https://github.com/KarrLab/karr_lab_docker_images/tree/master/build>`_.
7779

78-
See the :numref:`building_linux_containers` for more information.
80+
See :ref:`How to build a Ubuntu Linux image with Docker` for more information.
7981

8082
The Karr Lab uses both of these mechanisms.
8183

8284
Changing package dependencies for a CircleCI build
8385
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
84-
Occasionally, you may need to change the dependencies of a repository. The following recipe can be used to update the PyPI dependencies of a repository:
86+
Occasionally, you may need to change the dependencies of a repository. The following steps can perform this task:
87+
88+
#. Update the ``pip`` ``requirements.txt`` files which identify packages that the repository uses. To automate this process, use the commands in `karr_lab_build_utils <https://docs.karrlab.org/karr_lab_build_utils/latest/tutorial_developers.html#managing-dependencies-of-packages>`_ that can obtain a package's dependencies and identify dependencies that may be missing or unnecessary.
89+
90+
* ``./requirements.txt`` describes the dependencies of the package. It lists the package's immediate dependencies, i.e., the other packages that are imported, and may constraint which versions are suitable for the package. It should not contain URLs, specify the source which should provide a package, or specify the specific version of a dependency to install. The systems administrator who configures the package's environment, not the programmer, should be responsible for these details.
91+
* ``./requirements.optional.txt`` describes the package's optional dependencies.
92+
* ``./tests/requirements.txt`` lists the dependencies of the package's tests.
93+
* ``./docs/requirements.txt`` describes the dependencies of the software that compiles the package's documentation.
94+
* ``.circleci/requirements.txt`` tells CircleCI where to obtain dependencies that are not located in PyPI. Dependencies can be identified by GitHub URLs with the format ``git+https://github.com/--account_name--/--package_name--.git#egg=--package_name--``. All dependencies--including transitive dependencies--must be listed. The list must be arranged in dependency order, so that if package `y` depends on package `x` then `x` precedes `y`, as in a `topological sort <https://en.wikipedia.org/wiki/Topological_sorting>`_ of the dependencies. This file works around limitations in pip and PyPI.
95+
* ``./docs/requirements.rtd.txt`` tells Read the Docs where to obtain dependencies that are not located in PyPI.
8596

86-
#. Update the ``pip`` ``requirements.txt`` files which describe the dependencies of the package, its tests, and its documentation. This includes ``./requirements.txt`` which describes the dependencies of the package, ``./requirements.optional.txt`` which describes optional dependencies of the package, ``./tests/requirements.txt`` which describes the dependencies of the package's tests, ``./docs/requirements.txt`` which describes the dependencies of the package's documentation, and ``.circleci/requirements.txt`` and ``./docs/requirements.rtd.txt`` which tell CircleCI and Read the Docs where to obtain dependencies that are not located in PyPI.
8797
#. Commit the changes to the ``requirements.txt`` files to your code repository.
8898

8999
If there are errors in the compilation and/or installation of the new dependencies, you can try rebuilding the build without its cache. As described above, we recommend using CircleCI's cache to avoid repeatedly recompiling dependent packages. The cache avoids recompiling dependent packages by storing them after the first time they are built, and loading them on subsequent builds. You can force CircleCI to create a new cache by incrementing the cache version number ``vXXX`` specified in ``.circleci/config.yml`` and pushing the updated configuration file to your code repository::

docs/concepts_skills/software_engineering/distributing_python.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ There are also several online tutorials with more information about how to uploa
262262

263263
Distributing containers with Docker Hub
264264
---------------------------------------
265-
Docker Hub can be used to distribute virtual machines simply by changing the public/private setting of a repository. See :numref:`building_linux_containers` for more information about using Docker and Docker Hub.
265+
Docker Hub can be used to distribute virtual machines simply by changing the public/private setting of a repository. See :ref:`How to build a Ubuntu Linux image with Docker` for more information about using Docker and Docker Hub.
266266

267267

268268
Distributing documentation with Read The Docs

docs/concepts_skills/software_engineering/structuring_python_projects.rst

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,50 @@ Structuring Python projects
22
===========================
33
We recommend using the following principles to organize Python projects:
44

5-
* Use separate repositories for each project
5+
* Use a separate repository for each project
66
* Store only one package in each repository
7-
* Structure each package as outlined below following the recommendations provided by `The Hitchhiker's Guide To Python <http://python-guide-pt-br.readthedocs.io/en/latest/writing/structure/>`_:
7+
* Structure each package as outlined below, following the recommendations provided by `The Hitchhiker's Guide To Python <https://docs.python-guide.org/writing/structure/#structure-of-the-repository>`_:
88

99
.. code-block :: text
1010
11-
repository_name/ # source code directory
12-
__init__.py # each source code directory must contain an ``__init__.py`` file
11+
repository_name/ # source code directory (1)
12+
__init__.py # each source code directory must contain an __init__.py file
1313
__main__.py # optional, for command line programs
1414
VERSION # text file with version number
1515
data/ # directory for data files needed by the code
1616
tests/ # directory for test code
1717
fixtures/ # fixtures for tests
18-
secret/ # git-ignored fixtures that contain usernames, passwords, and tokens
19-
requirements.txt # list of packages required to run the tests; used by CircleCI
18+
secret/ # git-ignored fixtures containing usernames, passwords, and tokens
19+
requirements.txt # list of packages required to run the tests, but not
20+
# required by the project; used by CircleCI (2, 3)
2021
docs/ # directory for documentation
2122
conf.py # documentation configuration
2223
index.rst # main documentation file
23-
requirements.txt # list of packages required to compile the documentation
24-
requirements.rtd.txt # list of packages required to compile the documentation; used by Read the Docs
24+
requirements.txt # packages required to compile the documentation (2, 3)
25+
requirements.rtd.txt # list of packages required to compile the documentation;
26+
# used by Read the Docs (2)
2527
_build/html/ # directory where compiled documentation is saved
26-
_static # optional for static files such as .css and .js files needed for the documentation
28+
_static # optional for static files such as .css and .js files
29+
# needed for the documentation
2730
examples/ # (optional) directory for examples of how to use the code
2831
LICENSE # license file
2932
MANIFEST.in # list of files that should be distributed with the package
3033
README.md # Read me file; displayed by GitHub
31-
requirements.txt # list of requirements
32-
requirements.optional.txt # list of optional requirements
34+
requirements.txt # list of required packages (2, 3)
35+
requirements.optional.txt # list of optional requirements (2, 3)
3336
setup.cfg # options for the installation script
3437
setup.py # installation script
3538
.circleci/ # directory for CircleCI configuration
3639
config.yml # CircleCI configuration
37-
requirements.txt # list of locations of requirements not in PyPI
38-
downstream_dependencies.yml # List of downstream dependencies in YAML format
40+
requirements.txt # list of locations of requirements not in PyPI (2, 3)
41+
downstream_dependencies.yml # List of downstream dependencies in YAML format (3)
3942
.gitignore # list of file paths and extensions that Git should ignore
4043
.readthedocs.yml # Read the Docs configuration
4144
42-
*Note: the name of the source code directory should be the same as that of the repository*
45+
\(1\) The name of the source code directory should be the same as that of the repository.
4346

44-
* Separate code which is useful on its own, distinct from the project, into their own packages and repositories
47+
\(2\) For details about `requirements.txt` files see the section about :ref:`Changing package dependencies for a CircleCI build`.
48+
49+
\(3\) These dependencies can be determined automatically by `karr_lab_build_utils <https://docs.karrlab.org/karr_lab_build_utils/latest/tutorial_developers.html#managing-dependencies-of-packages>`_.
50+
51+
* Separate code that is useful on its own---distinct from the project, into independent packages and repositories.

docs/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Run the following command to install the latest version from GitHub::
5050
==========================================================================
5151
Detailed instructions to install the tutorials and all of the requirements
5252
==========================================================================
53-
#. Follow the instructions in :numref:`building_linux_containers` to build a Linux virtual machine
53+
#. Follow the instructions in :ref:`How to build a Ubuntu Linux image with Docker` to build a Linux virtual machine
5454
#. Install several packages
5555

5656
#. Enable the Docker Aptitude repository::

0 commit comments

Comments
 (0)