Compare commits

..

No commits in common. "main" and "start_workflow" have entirely different histories.

47 changed files with 283 additions and 3075 deletions

10
.gitignore vendored
View File

@ -1,12 +1,2 @@
pkglists/*
output/*
outputs/*
cache/*
examples/*
.snakemake/*
artifacts/json/*
pkglist.csv
log.txt
build_status.csv
*.pdf
blacklists/*

674
LICENSE
View File

@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

207
README.md
View File

@ -1,208 +1,3 @@
# Study of the Reproducibility and Longevity of Dockerfiles
The aim of this study is to show the current practices with Docker in High Performance Computing (HPC) conferences' artifacts.
This repository contains the code and the artifacts used for the study.
## Components of the workflow
The workflow is managed by Snakemake. Below are brief explanations on the various components of this workflow. Further details can be found in the chapter "Usage".
### Artifact configuration files
This repository contains configuration files for multiple artifacts from HPC conferences. These configuration files contain multiple informations that are used by ECG to build the Docker container and perform a software environment analysis.
You can suggest your own configuration files by following the protocol given inside the `protocol` directory (protocol is still WIP).
### ECG
ECG is a program that automates software environment checking for scientific artifacts that use Docker. It takes as input a JSON configuration telling where to download the artifact, where to find the Dockerfile to build in the artifact, and which package sources are used by the Docker container.
It will then download the artifact, build the Dockerfile, and then create a list of the installed packages in the Docker container (if it was built successfully). It also stores the potential errors encountered when building the Dockerfile, and logs the hash of the artifact for future comparison.
It is meant to be executed periodically to analyze variations in the software environment of the artifact through time.
Supported package sources:
- `dpkg`
- `rpm`
- `pacman`
- `pip`
- `conda`
- `git`
- `misc` *(miscellaneous packages are packages that have been installed outside of a package manager or VCS such as Git)*
### Analysis
Multiple type of analysis are done with the output of ECG to create tables that can later be plotted. The analysis done for this study are software environment, artifact, and build status analysis. Each type of analysis is done through a different script.
### Plots with R
The plotting script can generate both line and bar plots using the analysis results.
## Setup
A Linux operating system and the following packages are required:
- `python`
- `docker`
- `snakemake`
- `gawk`
- `nickel`
- `sed`
The following Python package is also required:
- `requests`
Otherwise, you can use the Nix package manager and run `nix develop` in this directory to setup the full software environment.
## Usage
### Running the whole workflow
First, open `config/config.yaml` and set `system` to `local` to run the workflow on your local machine, or to `g5k` to run it on the Grid'5000 testbed.
Then, run the following command at the root directory of this repository:
```
snakemake --cores <nb_cores>
```
Where `<nb_cores>` is the number of cores you want to assign to the workflow. The number of cores determine the number of instances of ECG that can run in parallel, so you may want to assign as many cores as possible here.
### Running each component separately
#### Artifact configuration files
Under `artifacts/nickel`, you will find some configuration files in the Nickel format. You will need to run the following command to convert a configuration file in the JSON format to make it readable for ECG and to check for errors:
```
nickel export --format json --output <output_path> <<< 'let {Artifact, ..} = import "'workflow/nickel/artifact_contract.ncl'" in ((import "'<input_config>'") | Artifact)'
```
Where:
- `<input_config>` is the configuration file in the Nickel format to check and convert to JSON.
- `<output_path>` is the path where to store the converted configuration file.
#### ECG
Run `ecg.py` as follow:
```
python3 ecg.py <config_file> -p <pkglist_path> -b <build_status_file> -a <artifact_hash_log> -c <cache_directory>
```
Where:
- `<config_file>` is the configuration file of the artifact in JSON format. WARNING: The name of the file (without the extension) must comply with the Docker image naming convention: only characters allowed are lowercase letters and numbers, separated with either one "." maximum, or two "_" maximum, or an unlimited number of "-", and should be of 128 characters maximum.
- `<pkglist_path>` is the path to the file where the package list generated by the program should be written.
- `<build_status_file>` is the path to the file where to write the build status of the Docker image given in the configuration file.
- `<artifact_hash_log>` is the path to the file where to log the hash of the downloaded artifact.
- `<cache_directory>` is the path to the cache directory, where downloaded artifacts will be stored for future usage. If not specified, cache is disabled.
You can also use `--docker-cache` to enable the cache of the Docker layers.
##### Outputs
###### Package list
The list of packages installed in the container, depending on the sources (a package manager, `git` or `misc`) given in the config file, in the form of a CSV file, with the following columns in order:
| Package name | Version | Source | Config name | Timestamp |
|--------------|---------|-----------------|-------------|-----------|
For Git packages, the hash of the last commit is used as version number. For miscellaneous packages, the hash of the file that has been used to install the package is used as version number. The timestamp corresponds to the time when ECG started building the package list, so it will be the same for each package that has been logged during the same execution of ECG.
###### Build status file
The log of the attempts to build the Docker image, in the form of a CSV file, with the following columns in order:
| Config name | Timestamp | Result |
|-------------|-----------|-----------------|
The timestamp corresponds to when the result is being logged, not to when it happened.
The following are the possible results of the build:
- `success`: The Docker image has been built successfully.
- `package_install_failed`: A command requested the installation of a package that failed.
- `baseimage_unavailable`: The base image needed for this container is not available.
- `artifact_unavailable`: The artifact could not be downloaded.
- `dockerfile_not_found`: No Dockerfile has been found in the location specified in the configuration file.
- `script_crash`: An error has occurred with the script itself.
- `job_time_exceeded`: When running on a batch system such as OAR, this error indicates that the script exceeded the allocated run time and had to be terminated.
- `unknown_error`: Any other error.
###### Artifact hash log
The log of the hash of the artifact archive file, in the form of a CSV file, with the following columns in order:
| Timestamp | Hash | Config name |
|-----------|------|-------------|
The timestamp corresponds to when the hash has been logged, not to when the artifact has been downloaded. If the artifact couldn't be downloaded, the hash is equal to `-1`.
#### Analysis
Under the folder `analysis`, you will find multiple analysis scripts. These scripts take as input the outputs of ECG to generate tables that can then be plotted by another program.
All the analysis scripts can be run the same way:
```
python3 <analysis_script> -i <input_table1> -i <input_table2> ... -o <output_table>
```
Where:
- `<analysis_script>` is one of the following analysis scripts.
- `<input_table1>`, `<input_table2>`... are one or more output tables from ECG. The required ECG output depends on the analysis script, see below.
- `<output_table>` is the path where to store the table generated by the analysis script.
The outputs are CSV files with the following structure:
| Category 1 | Category 2 | ... | Timestamp |
|------------|------------|-----|-----------|
Where `Category 1`, `Category 2`, ... are the categories (package sources, build status or artifact status) being measured by the analysis functions. For each category, the amount of entities (packages, containers or artifacts) belonging to this category is given in the respective column. Categories are clarified below for each type of analysis.
The timestamp corresponds to the time when the output file is being written.
##### Software environment analysis
The script `softenv_analysis.py` performs a software environment analysis by parsing one or more package lists generated by ECG.
Depending on the type of analysis, multiple tables can be generated:
- `sources-stats`: Number of packages per source (a package manager, `git` or `misc`).
- `pkgs-changes`: Number of packages that changed over time (`0` if only one file is given, since it will only include the package list of a single execution).
The type of analysis can be specified using the option `-t`.
The categories are all the package sources supported by ECG, in the following order: `dpkg, rpm, pacman, pip, conda, git, misc`
##### Artifact analysis
The script `artifact_analysis.py` performs an artifact analysis by parsing one or more artifact hash logs generated by ECG.
The table generated by this script gives the amount of artifacts that are available or not available, and the amount of artifacts that have been modified over time.
The categories are all possible artifacts' status, in the following order : `available, unavailable, changed`
##### Build status analysis
The script `buildstatus_analysis.py` performs a build status analysis by parsing one or more build status log generated by ECG.
The table generated by this script gives the amount of images that have been built successfully, and the amount of images that failed to build, for each category of error.
The categories are all build status supported by ECG, in the following order : `success, package_install_failed, baseimage_unavailable, artifact_unavailable, dockerfile_not_found, script_crash, job_time_exceeded, unknown_error`
#### Plots with R
Under the directory `plot`, you will find a `plot.r` script. Run it as follow:
```
Rscript plot.r <plot_type> <analysis_table> <output_plot> <column1> <column2> ...
```
Where:
- `<plot_type>` is either `line` or `bar` depending if you want to produce a line or a bar plot from the given table.
- `<analysis_table>` is the path to the analysis table produced by an analysis script.
- `<output_plot>` is the path where the script will store the generated plot.
- `<column1> <column2> ...` are the headers of the columns of the given table.
## License
This project is licensed under the GNU General Public License version 3. You can find the terms of the license in the file LICENSE.
TODO: doc

View File

@ -1,169 +0,0 @@
#!/bin/python3
"""
This script performs an artifact analysis on the outputs of the workflow
to generate tables that can then be plotted by another program.
"""
import argparse
import csv
import os
import datetime
def artifact_changed(table, name):
"""
Indicates whether the artifact of the given name has changed over time.
An artifact becoming unavailable is considered as modified.
Parameters
----------
table: list
Artifact hash log table.
name: str
Name of the artifact to check.
Returns
-------
bool
True if artifact changed, False otherwise.
"""
changed = False
i = 0
artifact_hash = ""
while i < len(table) and not changed:
row = table[i]
if row[2] == name:
# If the first hash has not been saved yet:
if artifact_hash == "":
artifact_hash = row[1] # Hash is in the 2nd column
elif row[1] != artifact_hash:
changed = True
i += 1
return changed
def artifact_available(table, name):
"""
Indicates whether the artifact of the given name is still available.
Parameters
----------
table: list
Artifact hash log table.
name: str
Name of the artifact to check.
Returns
-------
bool
True if artifact is still available, False otherwise.
"""
available = True
for row in table:
if row[2] == name:
if row[1] == "-1":
# -1 means the artifact could not be downloaded. Otherwise,
# this column would contain the hash of the artifact.
available = False
else:
available = True
# The last log of the artifact hash will determine if the artifact is
# currently available or not.
return available
def analysis(input_table):
"""
Analyzes the given artifact hash table to determine if the artifacts are
still available and didn't change, changed, or aren't available anymore.
Parameters
----------
input_table: str
Table to analyse.
Returns
-------
dict
Output table of the analysis in the form of a dict with headers as keys.
"""
artifacts = {"available":0, "unavailable":0, "changed":0}
checked = [] # Artifacts that have been checked already
for row in input_table:
artifact_name = row[2] # Name of the artifact in the 3rd column
if artifact_name not in checked:
if artifact_available(input_table, artifact_name):
artifacts["available"] += 1
else:
artifacts["unavailable"] += 1
if artifact_changed(input_table, artifact_name):
artifacts["changed"] += 1
checked.append(artifact_name)
return artifacts
def main():
# Command line arguments parsing:
parser = argparse.ArgumentParser(
prog = "artifact_analysis",
description =
"""
This script performs an artifact analysis on the outputs of the workflow
to generate tables that can then be plotted by another program.
The generated table gives the amount of artifacts that are available
or not available, and the amount of artifacts that have been modified
over time.
"""
)
parser.add_argument(
"-v", "--verbose",
action = "store_true",
help = "Shows more details on what is being done."
)
parser.add_argument(
"-i", "--input",
action = "append",
nargs = "+",
help =
"""
The CSV file used as input for the analysis function. Multiple files
can be specified at once by separating them with a space.
All the input files must be artifact hash logs generated by ECG.
""",
required = True
)
parser.add_argument(
"-o", "--output",
help =
"""
Path to the output CSV file that will be created by the analysis function.
""",
required = True
)
args = parser.parse_args()
inputs = args.input
output_path = args.output
# Parsing the input files:
input_table = []
for i in inputs:
for path in i:
input_file = open(path)
input_table += list(csv.reader(input_file))
input_file.close()
# Analyzing the inputs:
output_dict = analysis(input_table)
# Adding the current time to every row:
now = datetime.datetime.now()
timestamp = str(datetime.datetime.timestamp(now))
output_dict["timestamp"] = timestamp
# Writing analysis to output file:
output_file = open(output_path, "w+")
dict_writer = csv.DictWriter(output_file, fieldnames=output_dict.keys())
# dict_writer.writeheader()
dict_writer.writerow(output_dict)
output_file.close()
if __name__ == "__main__":
main()

View File

@ -1,102 +0,0 @@
#!/bin/python3
"""
This script performs a build status analysis on the outputs of the workflow
to generate tables that can then be plotted by another program.
"""
import argparse
import csv
import os
import datetime
def analysis(input_table):
"""
Analyzes the given build status table to count the results of the building
of the Dockerfile for each category.
Parameters
----------
input_table: str
Table to analyse.
Returns
-------
dict
Output table of the analysis in the form of a dict with headers as keys.
"""
# All build status, initialized to 0.
# This is required to make the column of the result table deterministic,
# so they can be determined without the header in the CSV file.
buildstatus = {"success":0, "package_install_failed":0, "baseimage_unavailable":0, "artifact_unavailable":0, "dockerfile_not_found":0, "script_crash":0, "job_time_exceeded":0, "unknown_error":0}
for row in input_table:
# Third column is the result:
buildstatus[row[2]] += 1
return buildstatus
def main():
# Command line arguments parsing:
parser = argparse.ArgumentParser(
prog = "buildstatus_analysis",
description =
"""
This script performs a build status analysis on the outputs of the
workflow to generate tables that can then be plotted by another program.
The generated table gives the amount of images that have been
built successfully, and the amount of images that failed to build,
for each category of error.
"""
)
parser.add_argument(
"-v", "--verbose",
action = "store_true",
help = "Shows more details on what is being done."
)
parser.add_argument(
"-i", "--input",
action = "append",
nargs = "+",
help =
"""
The CSV file used as input for the analysis function. Multiple files
can be specified at once by separating them with a space.
All the input files must be build status logs generated by ECG.
""",
required = True
)
parser.add_argument(
"-o", "--output",
help =
"""
Path to the output CSV file that will be created by the analysis function.
""",
required = True
)
args = parser.parse_args()
inputs = args.input
output_path = args.output
# Parsing the input files:
input_table = []
for i in inputs:
for path in i:
input_file = open(path)
input_table += list(csv.reader(input_file))
input_file.close()
# Analyzing the inputs:
output_dict = analysis(input_table)
# Adding the current time to every row:
now = datetime.datetime.now()
timestamp = str(datetime.datetime.timestamp(now))
output_dict["timestamp"] = timestamp
# Writing analysis to output file:
output_file = open(output_path, "w+")
dict_writer = csv.DictWriter(output_file, fieldnames=output_dict.keys())
# dict_writer.writeheader()
dict_writer.writerow(output_dict)
output_file.close()
if __name__ == "__main__":
main()

View File

@ -1,213 +0,0 @@
#!/bin/python3
"""
This script performs a software environment analysis on the outputs
of the workflow to generate tables that can then be plotted by another
program.
"""
import argparse
import csv
import os
import datetime
# All possible package sources, initialized to 0.
# This is required to make the column of the result table deterministic,
# so they can be determined without the header in the CSV file.
pkgsources = {"dpkg":0, "rpm":0, "pacman":0, "pip":0, "conda":0, "git":0, "misc":0}
def sources_stats(input_table, pkgsources):
"""
Analyzes the given package lists table to determine the number of artifacts
using a package manager, Git packages or misc packages.
Parameters
----------
input_table: str
Table to analyse.
pkgsources: dict
A dictionnary that contains all the possible package sources as keys,
with all keys' value initialized at 0.
Returns
-------
dict
Output table of the analysis in the form of a dict with headers as keys.
"""
i = 0
for row in input_table:
# Third column is the package source:
if row[2] not in pkgsources:
pkgsources[row[2]] = 1
else:
pkgsources[row[2]] += 1
return pkgsources
def pkg_changed(table, artifact_name, pkgname, pkgsource):
"""
Analyzes the given package lists table to determine if the given package
changed for the given artifact.
Parameters
----------
table: str
Table to analyse.
artifact_name: str
Name of the artifact for which we want to analyze package changes.
pkgname: str
The package we want to track changes.
pkgsource: str
Source of the package, in case there is multiple packages with the
same name but different sources.
Returns
-------
changed: bool
True if the version number of the package changed over time, False
otherwise.
"""
changed = False
i = 0
pkgver = ""
while i < len(table) and not changed:
row = table[i]
# Artifact name is in the 4th column, package name in the first,
# and package source in the 3rd:
if row[3] == artifact_name and row[0] == pkgname and row[2] == pkgsource:
# If the first version number has not been saved yet:
if pkgver == "":
pkgver = row[1] # Package version is in the 2nd column
elif row[1] != pkgver:
changed = True
i += 1
return changed
def pkgs_changes(input_table, pkgsources):
"""
Analyzes the given package lists table to determine the number of packages
that changed for every package source.
Parameters
----------
input_table: str
Table to analyse.
pkgsources: dict
A dictionnary that contains all the possible package sources as keys,
with all keys' value initialized at 0.
Returns
-------
dict
Output table of the analysis in the form of a dict with headers as keys.
"""
# Key is the artifact name, and value is a list of tuples constituted
# of the package that has been checked and its source for this artifact:
# FIXME: Memory usage?
checked_artifacts = {}
i = 0
for row in input_table:
artifact_name = row[3] # Artifact name is in the 4th column
if artifact_name not in checked_artifacts.keys():
checked_artifacts[artifact_name] = []
pkgname = row[0] # Package name is in the first column
pkgsource = row[2] # Package source is in the 3rd column
if (pkgname, pkgsource) not in checked_artifacts[artifact_name]:
if pkg_changed(input_table, artifact_name, pkgname, pkgsource):
pkgsources[pkgsource] += 1
checked_artifacts[artifact_name].append((pkgname, pkgsource))
return pkgsources
def pkgs_per_container(input_table):
print("ERROR: Not implemented!")
def main():
# Command line arguments parsing:
parser = argparse.ArgumentParser(
prog = "softenv_analysis",
description =
"""
This script performs a software environment analysis on the outputs
of the workflow to generate tables that can then be plotted
by another program.
"""
)
parser.add_argument(
"-v", "--verbose",
action = "store_true",
help = "Shows more details on what is being done."
)
parser.add_argument(
"-t", "--analysis-type",
help =
"""
Specify the type of software analysis to run. Depending on the
type of analysis, multiple tables can be generated:
the number of packages per source (a package manager, git or misc)
by using `sources-stats`,
the number of packages that changed over time (0 if only
one file is given, since it will only include the package list
of a single execution) by using `pkg-changes`,
the number of packages per container by specifying `pkgs-per-container`.
""",
choices = ["sources-stats", "pkgs-changes", "pkgs-per-container"],
required = True
)
parser.add_argument(
"-i", "--input",
action = "append",
nargs = "+",
help =
"""
The CSV file used as input for the analysis function. Multiple files
can be specified at once by separating them with a space.
All the input files must be package lists generated by ECG.
""",
required = True
)
parser.add_argument(
"-o", "--output",
help =
"""
Path to the output CSV file that will be created by the analysis function.
""",
required = True
)
args = parser.parse_args()
inputs = args.input
output_path = args.output
analysis_type = args.analysis_type
# Parsing the input files:
input_table = []
for i in inputs:
for path in i:
input_file = open(path)
input_table += list(csv.reader(input_file))
input_file.close()
# Analyzing the inputs:
if analysis_type == "sources-stats":
output_dict = sources_stats(input_table, pkgsources)
elif analysis_type == "pkgs-changes":
output_dict = pkgs_changes(input_table, pkgsources)
elif analysis_type == "pkgs-per-container":
output_dict = pkgs_per_container(input_table)
# Adding the current time to every row:
now = datetime.datetime.now()
timestamp = str(datetime.datetime.timestamp(now))
output_dict["timestamp"] = timestamp
# Writing analysis to output file:
output_file = open(output_path, "w+")
dict_writer = csv.DictWriter(output_file, fieldnames=output_dict.keys())
# dict_writer.writeheader()
dict_writer.writerow(output_dict)
output_file.close()
if __name__ == "__main__":
main()

15
artifacts/example.yaml Normal file
View File

@ -0,0 +1,15 @@
artefact_url: "https://example.com/artifact.zip"
type: "zip" # Possible values: zip, tgz
doi: "XX.XXXX/XXXXXXX.XXXXXXX"
dockerfiles:
- name: "image1:version"
location: "path/to/docker/folder"
package_managers:
- "dpkg" # Possible values: dpkg, rpm, pacman, pip, conda
git_packages:
- name: "pkg1"
location: "path/to/git/repo"
misc_packages:
- name: "mpkg1"
url: "https://example.com/package1.zip"
type: "zip" # Possible values: zip, tgz

View File

@ -1,20 +0,0 @@
{
version = "1.0",
artifact_url = "https://github.com/brownsys/K9db/archive/refs/tags/osdi2023.zip",
type = "zip",
doi = "...",
conf_date = 2023,
comment = "",
virtualization = "docker",
buildfile_dir = "K9db-osdi2023",
package_managers = [ "dpkg", "pip" ],
git_packages = [],
misc_packages = [
{ name = "bazel-4.0.0-installer-linux-x86_64", url = "https://github.com/bazelbuild/bazel/releases/download/4.0.0/bazel-4.0.0-installer-linux-x86_64.sh" },
{ name = "rust", url = "https://sh.rustup.rs" },
{ name = "mariadb-connector-cpp-1.0.0-ubuntu-groovy-amd64", url = "https://dlm.mariadb.com/1601342/Connectors/cpp/connector-cpp-1.0.0/mariadb-connector-cpp-1.0.0-ubuntu-groovy-amd64.tar.gz" }
],
python_venvs = [
{ path = "/home/k9db/experiments/scripts/plotting/venv" }
]
}

View File

@ -1,33 +0,0 @@
{
version = "1.0",
artifact_url = "https://zenodo.org/record/7544675/files/SF2-code.tar.gz",
type = "tar",
doi = "10.1145/3572848.3577480",
conf_date = 2023,
comment = "",
virtualization = "docker",
buildfile_dir = "bdm-paper-examples/docker",
package_managers = [ "dpkg" ],
git_packages = [
{ name = "pyenv", location = "~/.pyenv" }
],
misc_packages = [
{
name = "NetLogo-6.2.0-64",
url = "http://ccl.northwestern.edu/netlogo/6.2.0/NetLogo-6.2.0-64.tgz"
},
{
name = "root_v6.22.06_python3.9_ubuntu-20.04",
url = "http://biodynamo-lfs.web.cern.ch/biodynamo-lfs/third-party/root_v6.22.06_python3.9_ubuntu-20.04.tar.gz"
},
{
name = "qt_v5.12.10_ubuntu-20.04",
url = "http://biodynamo-lfs.web.cern.ch/biodynamo-lfs/third-party/qt_v5.12.10_ubuntu-20.04.tar.gz"
},
{
name = "paraview_v5.9.0_ubuntu-20.04_default",
url = "http://biodynamo-lfs.web.cern.ch/biodynamo-lfs/third-party/paraview_v5.9.0_ubuntu-20.04_default.tar.gz"
},
],
python_venvs = []
}

View File

@ -1,13 +0,0 @@
{
version = "1.0",
artifact_url = "https://zenodo.org/records/11636529/files/artifact-pap130.zip",
type = "zip",
doi = "10.5281/zenodo.11636529",
conf_date = 2024,
virtualization = "docker",
buildfile_dir = ".docker",
package_managers = [ "dpkg" ],
misc_packages = [
{ name = "gurobi10.0.1_linux64", url = "https://packages.gurobi.com/10.0/gurobi10.0.1_linux64.tar.gz" }
]
}

View File

@ -1,10 +0,0 @@
{
version = "1.0",
artifact_url = "https://zenodo.org/records/11547063/files/artifact.zip",
type = "zip",
doi = "10.5281/zenodo.11547063",
conf_date = 2024,
virtualization = "docker",
buildfile_dir = "artifact",
package_managers = [ "dpkg", "pip" ]
}

View File

@ -1,17 +0,0 @@
{
version = "1.0",
artifact_url = "https://zenodo.org/records/11558678/files/peanuts-playground.zip",
type = "zip",
doi = "10.5281/zenodo.11558678",
conf_date = 2024,
comment = "Files in /var/lib/apt/lists/ are removed.",
virtualization = "docker",
buildfile_dir = "./",
package_managers = [ "dpkg" ],
git_packages = [
{ name = "spack", location = "/home/vscode/.cache/spack" }
],
misc_packages = [
{ name = "cmake-3.22.2-linux", url = "https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2-linux-x86_64.sh" }
]
}

View File

@ -1,14 +0,0 @@
{
version = "1.0",
artifact_url = "https://zenodo.org/record/6632461/files/SC22_artifacts_submission.zip",
type = "zip",
doi = "10.5555/3571885.3571906",
conf_date = 2022,
comment = "",
virtualization = "docker",
buildfile_dir = "SC22_artifacts_submission",
package_managers = [ "dpkg", "pip" ],
git_packages = [],
misc_packages = [],
python_venvs = []
}

View File

@ -1,10 +0,0 @@
{
version = "1.0",
artifact_url = "https://zenodo.org/records/11579181/files/bsa_spmm.zip",
type = "zip",
doi = "10.5281/zenodo.11579181",
conf_date = 2024,
comment = "Are there really Dockerfiles for this artifact?",
virtualization = "docker",
package_managers = [ "dpkg" ],
}

View File

@ -1,20 +0,0 @@
{
version = "1.0",
artifact_url = "https://zenodo.org/record/7508499/files/wsmoses/PolygeistGPU-Docker-v0.2.1.zip",
type = "zip",
doi = "10.1145/3572848.3577475",
conf_date = 2023,
comment = "",
virtualization = "docker",
buildfile_dir = "wsmoses-PolygeistGPU-Docker-ba18197/MocCUDA",
package_managers = [ "dpkg", "pip" ],
git_packages = [
{ name = "MocCUDA", location = "/root/MocCUDA" }
],
misc_packages = [
{ name = "cmake-3.23.1", url = "https://github.com/Kitware/CMake/releases/download/v3.23.1/cmake-3.23.1.tar.gz" }
],
python_venvs = [
{ path = "/root/MocCUDA/py3_venv" }
]
}

View File

@ -1,16 +0,0 @@
{
version = "1.0",
artifact_url = "https://zenodo.org/record/6926481/files/koparasy/HPAC-v0.0.0-Puppeteer.zip",
type = "zip",
doi = "10.5555/3571885.3571974",
conf_date = 2022,
comment = "The package 'cmake-3.14.0-Linux-x86_64' is not specified below, because it is installed using a Bash script included in the artifact archive itself. The file puppet_env.sh is missing and may hold information about a possible Python venv.",
virtualization = "docker",
buildfile_dir = "koparasy-HPAC-2723bb8/approx/puppeteer/container",
package_managers = [ "dpkg", "pip" ],
git_packages = [],
misc_packages = [
{ name = "HPAC", url = "https://github.com/koparasy/HPAC/archive/refs/heads/develop.zip" }
],
python_venvs = []
}

View File

@ -1,23 +0,0 @@
{
version = "1.0",
artifact_url = "https://github.com/microsoft/nnfusion/archive/refs/heads/osdi2023welder.zip",
type = "zip",
doi = "",
conf_date = 2023,
comment = "",
buildfile_dir = "nnfusion-osdi2023welder",
virtualization = "docker",
package_managers = [ "dpkg", "pip", "conda" ],
git_packages = [
{ name = "tvm", location = "/root/tvm" },
{ name = "nnfusion", location = "/root/nnfusion" },
{ name = "cutlass", location = "/root/cutlass" }
],
misc_packages = [
{
name = "Miniconda3-py310_23.1.0-1-Linux-x86_64",
url = "https://repo.anaconda.com/miniconda/Miniconda3-py310_23.1.0-1-Linux-x86_64.sh"
}
],
python_venvs = []
}

View File

@ -1,20 +0,0 @@
{
version = "1.0",
artifact_url = "https://example.com/artifact.zip",
type = "zip",
doi = "...",
conf_date = 0,
comment = "Template for artifact configuration.",
virtualization = "docker",
buildfile_dir = "path/to/docker/folder",
package_managers = [ "dpkg", "rpm", "pacman", "pip", "conda" ],
git_packages = [
{ name = "pkg1", location = "path/to/git/repo" }
],
misc_packages = [
{ name = "mpkg1", url = "http://example.com/package.zip" }
],
python_venvs = [
{ path = "path/to/venv" }
]
}

View File

@ -1,16 +0,0 @@
{
version = "1.0",
artifact_url = "http://127.0.0.1/artifact.zip",
type = "zip",
doi = "...",
conf_date = 0,
virtualization = "docker",
buildfile_dir = "./",
package_managers = [ "dpkg", "pip" ],
misc_packages = [
{ name = "mpkg1", url = "http://127.0.0.1/package1.zip" }
],
python_venvs = [
{ path = "/prog" }
]
}

View File

@ -1,16 +0,0 @@
{
version = "1.0",
artifact_url = "https://zenodo.org/record/7328505/files/tgopt-artifact.tgz",
type = "tar",
doi = "10.1145/3572848.3577490",
conf_date = 2023,
comment = "",
virtualization = "docker",
buildfile_dir = "tgopt-artifact",
package_managers = [ "dpkg", "conda" ],
git_packages = [],
misc_packages = [
{ name = "Miniconda3-py37_4.12.0-Linux-x86_64", url = "https://repo.anaconda.com/miniconda/Miniconda3-py37_4.12.0-Linux-x86_64.sh" }
],
python_venvs = []
}

View File

@ -1,11 +0,0 @@
{
version = "1.0",
artifact_url = "https://zenodo.org/records/11775182/files/Euro-PAR_2024_paper_432.zip",
type = "zip",
doi = "10.5281/zenodo.11775182",
conf_date = 2024,
comment = "Files in /var/lib/apt/lists/ are removed.",
virtualization = "docker",
buildfile_dir = "./",
package_managers = [ "dpkg", "pip" ]
}

View File

@ -1,27 +0,0 @@
{
version = "1.0",
artifact_url = "https://zenodo.org/record/7004393/files/deinsum/sc22-artifact-0.4.zip",
type = "zip",
doi = "10.5555/3571885.3571918",
conf_date = 2022,
comment = "",
virtualization = "docker",
buildfile_dir = "deinsum-sc22-artifact-7559901/docker_cpu",
package_managers = [ "dpkg", "pip" ],
git_packages = [
{ name = "dace", location = "/dace" },
{ name = "multilinear-algebra-sc22-artifact", location = "/multilinear-algebra-sc22-artifact" },
{ name = "ctf", location = "/ctf" }
],
misc_packages = [
{
name = "mpich-3.1.4",
url = "http://www.mpich.org/static/downloads/3.1.4/mpich-3.1.4.tar.gz"
},
{
name = "Python-3.10.2",
url = "https://www.python.org/ftp/python/3.10.2/Python-3.10.2.tgz"
}
],
python_venvs = []
}

View File

@ -1,20 +0,0 @@
{
version = "1.0",
artifact_url = "https://zenodo.org/record/7004393/files/deinsum/sc22-artifact-0.4.zip",
type = "zip",
comment = "",
doi = "10.5555/3571885.3571918",
conf_date = 2022,
virtualization = "docker",
buildfile_dir = "deinsum-sc22-artifact-7559901/docker_gpu",
package_managers = [ "dpkg", "pip" ],
git_packages = [
{ name = "dace", location = "/dace" },
{ name = "multilinear-algebra-sc22-artifact", location = "/multilinear-algebra-sc22-artifact" },
{ name = "ctf", location = "/ctf" }
],
misc_packages = [
{ name = "pip", url = "https://bootstrap.pypa.io/get-pip.py" }
],
python_venvs = []
}

1
blacklist.csv Symbolic link
View File

@ -0,0 +1 @@
blacklists/blacklist.csv
1 blacklists/blacklist.csv

1
blacklists/blacklist.csv Normal file
View File

@ -0,0 +1 @@
sc24_test, IMAGE_NOT_FOUND, 0
1 sc24_test IMAGE_NOT_FOUND 0

View File

@ -1,4 +0,0 @@
let { Artifact, .. } = import "workflow/nickel/artifact_contract.ncl" in
(
(import "artifacts_nickel/example.ncl") | Artifact
)

View File

@ -1,14 +0,0 @@
folder_artifacts_nickel: "artifacts/nickel"
folder_artifacts_json: "artifacts/json"
folder_blacklists: "blacklists"
system: "local"
prefix: "outputs"
analysis_dir: "outputs/analysis"
plot_dir: "outputs/analysis/plot"
site: "grenoble"
cluster: "dahu"
max_duration: 60
checkpoint: 1
besteffort: True
sleep_time: 30

View File

@ -1,14 +0,0 @@
folder_artifacts_nickel: "artifacts/nickel"
folder_artifacts_json: "artifacts/json"
folder_blacklists: "blacklists"
system: "g5k" # can be "g5k" to run on the Grid'5000 testbed, or "local" for local execution
prefix: "outputs"
analysis_dir: "outputs/analysis"
site: "grenoble"
cluster: "dahu"
max_duration: 60 # 1 hour
checkpoint: 1 # 1 minute
besteffort: True
#sleep_time: 300 # 5 minutes
sleep_time: 30 # 0.5 minutes

628
ecg.py
View File

@ -10,491 +10,273 @@
import subprocess
import json
import yaml
import argparse
import tempfile
import os
import requests
import zipfile
import io
import tarfile
import pathlib
import logging
import datetime
import sys
import string
import traceback
def trim(url):
"""
Trims given URL to make it contain only lowercase letters and numbers,
as well as with a maximum length of 128.
# Paths:
ROOTPATH = pathlib.Path(__file__).parent.absolute()
output_path = "./output/"
Parameters
----------
url: str
URL to trim.
# Commands to list installed packages along with their versions and the name
# of the package manager, depending on the package managers.
# Each package manager is associated with a tuple, the first item being
# the query command, and the second being the command that will format
# the output of the query command (this one can be an empty string in case
# the formatting part is already done using the options of the first command).
# The first needs to be run on the container, and the second on the host,
# to take into account container images that do not have the formatting
# packages installed.
pkgmgr_cmd = {
"dpkg": ("dpkg -l", "awk 'NR>5 {print $2 \",\" $3 \",\" \"dpkg\"}'"), \
"rpm":("rpm -qa --queryformat '%{NAME},%{VERSION},rpm\\n'", ""), \
"pacman":("pacman -Q", "awk '{print $0 \",\" $1 \",pacman\"}'"), \
"pip":("pip freeze", "sed 's/==/,/g' | awk '{print $0 \",pip\"}'"), \
"conda":("/root/.conda/bin/conda list -e", "sed 's/=/ /g' | awk 'NR>3 {print $1 \",\" $2 \",conda\"}'")
}
Returns
-------
str
Trimmed URL.
"""
trimmed = ""
url_lc = url.lower()
i = 0
while i < len(url_lc) and i < 128:
c = url_lc[i]
if c in string.ascii_lowercase or c in [str(x) for x in range(0, 10)]:
trimmed += c
i += 1
return trimmed
# Command to obtain the latest commit hash in a git repository:
gitcmd = "git log -n 1 --pretty=format:%H"
def download_file(url, dest):
"""
Downloads the file stored at the given URL and returns its hash
and location.
# Enables logging:
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
Parameters
----------
url: str
URL to the file to download.
dest: str
Path to where the file should be stored.
# TODO: This will be used to log both to stdout and to a file:
class Logger(object):
def __init__(self):
self.terminal = sys.stdout
self.log = open("log.txt", "w")
Returns
-------
str
Hash of the downloaded file, or empty string if download failed.
"""
file_hash = "-1"
try:
req = requests.get(url)
if req.status_code != 404:
file = open(dest, "wb")
file.write(req.content)
file.close()
hash_process = subprocess.run(f"sha256sum {file.name} | cut -d ' ' -f 1 | tr -d '\n'", capture_output=True, shell=True)
file_hash = hash_process.stdout.decode("utf-8")
except requests.exceptions.ConnectionError:
# We can just ignore this exception, as we will just return an empty
# hash to indicate the error:
def write(self, message):
self.terminal.write(message)
self.log.write(message)
def flush(self):
# this flush method is needed for python 3 compatibility.
# this handles the flush command by doing nothing.
# you might want to specify some extra behavior here.
pass
return file_hash
def download_sources(config, arthashlog_path, dl_dir, use_cache, artifact_name):
def download_sources(config):
"""
Downloads the source of the artifact in 'config'.
Downloads the source of the artifact in 'config'.
Parameters
----------
config: dict
Parsed config file.
Parameters
----------
config: dict
Parsed YAML config file.
arthashlog_path: str
Path to the artifact hash log file.
dl_dir: str
Path to the directory where to download the artifact.
use_cache: bool
Indicates whether the cache should be used or not.
artifact_name: str
Name of the artifact, for the artifact hash log.
Returns
-------
temp_dir: str
Path to the directory where the artifact is downloaded to, or empty
string if download failed.
Returns
-------
temp_dir: tempfile.TemporaryDirectory
The directory where the artifact is downloaded to.
"""
url = config["artifact_url"]
artcache_dir = trim(url)
artifact_dir = os.path.join(dl_dir, artcache_dir)
# Checking if artifact in cache. Not downloading if it is:
if not os.path.exists(artifact_dir) or not use_cache:
logging.info(f"Downloading artifact from {url}")
# In case cache was used before:
if not use_cache:
os.system(f"rm -rf {artifact_dir}")
os.mkdir(artifact_dir)
artifact_file = tempfile.NamedTemporaryFile()
artifact_path = artifact_file.name
artifact_hash = download_file(url, artifact_path)
# If download was successful:
if artifact_hash != "-1":
if config["type"] == "zip":
artifact = zipfile.ZipFile(artifact_path)
elif config["type"] == "tar":
artifact = tarfile.open(artifact_path)
logging.info(f"Extracting artifact at {artifact_dir}")
artifact.extractall(artifact_dir)
# If download failed:
else:
os.rmdir(artifact_dir)
artifact_dir = ""
# Logging the current hash of the artifact:
arthashlog_file = open(arthashlog_path, "a")
now = datetime.datetime.now()
timestamp = str(datetime.datetime.timestamp(now))
# Artifact hash will be an empty string if download failed:
arthashlog_file.write(f"{timestamp},{artifact_hash},{artifact_name}\n")
arthashlog_file.close()
else:
logging.info(f"Cache found for {url}, skipping download")
return artifact_dir
def builderror_identifier(output):
logging.info(f"Downloading artifact from {url}")
temp_dir = tempfile.TemporaryDirectory()
req = requests.get(url)
if config["type"] == "zip":
artifact = zipfile.ZipFile(io.BytesIO(req.content))
elif config["type"] == "tgz":
artifact = tarfile.open(fileobj=io.BytesIO(req.content))
logging.info(f"Extracting artifact at {temp_dir.name}")
artifact.extractall(temp_dir.name)
return temp_dir
def build_image(config, src_dir):
"""
Parses the given 'output' to indentify the error.
Builds the given Docker image in 'config'.
Parameters
----------
output: str
Output of Docker.
Parameters
----------
config: dict
Part of the parsed YAML config file concerning the Docker image
to build.
Returns
-------
found_error: str
The error that has been found in the output, according to the
categories. If there is more than one, only the latest is taken into
account.
src_dir: tempfile.TemporaryDirectory
The directory where the artifact is stored.
Returns
-------
return_code: int
Return code of the Docker 'build' command.
"""
# Possible error messages given by 'docker build' and their category.
# The key is the category, the value is a tuple of error messages belonging to
# to this category:
build_errors = {
"package_install_failed":("Unable to locate package", "error: failed to compile"),
"baseimage_unavailable":("manifest unknown: manifest unknown",),
"dockerfile_not_found":("Dockerfile: no such file or directory",)
}
# Last error found is the right one in theory:
found_error = ""
unknown_error = True
for error_cat, error_msgs in build_errors.items():
for error in error_msgs:
if error in output:
unknown_error = False
found_error = error_cat
if unknown_error:
found_error = "unknown_error"
return found_error
def buildresult_saver(result, buildstatus_path, config_path):
"""
Saves the given result in the 'build_status' file.
Parameters
----------
result: str
The result of the build. Either a Docker 'build' error
(see 'builderror_identifier'), another type of error
(for instance 'artifact_unavailable'), or 'success'
if build is successful.
buildstatus_path: str
Path to the build status file.
config_path: str
Path to the config file.
Returns
-------
None
"""
buildstatus_file = open(buildstatus_path, "a")
artifact_name = os.path.basename(config_path).split(".")[0]
# # Writing header in case file didn't exist:
# if not file_exists:
# buildstatus_file.write("yaml_path,timestamp,error")
now = datetime.datetime.now()
timestamp = str(datetime.datetime.timestamp(now))
buildstatus_file.write(f"{artifact_name},{timestamp},{result}\n")
buildstatus_file.close()
def build_image(config, src_dir, image_name, docker_cache = False):
"""
Builds the given Docker image in 'config'.
Parameters
----------
config: dict
Parsed config file.
src_dir: str
Path to the directory where the artifact is stored.
image_name: str
Name of the Docker image.
docker_cache: bool
Enables or disables Docker 'build' cache.
Returns
-------
return_code: bool, build_output: str
Return code and output of Docker 'build'.
"""
cache_arg = " --no-cache"
if docker_cache:
cache_arg = ""
logging.info(f"Starting building image {image_name}")
path = os.path.join(src_dir, config["buildfile_dir"])
# Using trimmed artifact URL as name:
build_command = f"docker build{cache_arg} -t {image_name} ."
build_process = subprocess.run(build_command.split(" "), cwd=path, capture_output=True)
build_output = f"stdout:\n{build_process.stdout.decode('utf-8')}\nstderr:\n{build_process.stderr.decode('utf-8')}"
logging.info(f"Output of '{build_command}':")
logging.info(build_output)
name = config["name"]
logging.info(f"Starting building image {name}")
path = os.path.join(src_dir, config["location"])
build_command = "docker build -t " + config["name"] + " ."
# subprocess.check_call(config["build_command"].split(" "), cwd=path)
build_process = subprocess.run(build_command.split(" "), cwd=path, capture_output=False)
return_code = build_process.returncode
logging.info(f"Command '{build_command}' exited with code {return_code}")
return return_code, build_output
return return_code == 0
def check_env(config, src_dir, artifact_name, pkglist_path):
def check_env(config, src_dir):
"""
Builds a list of all software packages installed in the
Docker image given in 'config', depending on the package managers
specified in the configuration, then stores it in a CSV file.
Builds a list of all software packages installed in the
Docker image given in 'config', depending on the package managers
specified in the configuration, then stores it in a CSV file.
Parameters
----------
config: dict
Parsed config file.
Parameters
----------
config: dict
Part of the parsed YAML config file concerning the Docker image
where to check the environment.
src_dir: str
Path to the directory where the artifact is stored.
src_dir: tempfile.TemporaryDirectory
The directory where the artifact is stored.
artifact_name: str
Name of the artifact. Used both as the Docker image name, and for the
packages list for tracking purpose during the output analysis.
pkglist_path: str
Path to the package list file.
Returns
-------
None
Returns
-------
None
"""
# Saving the current time to add it to every row:
now = datetime.datetime.now()
timestamp = str(datetime.datetime.timestamp(now))
# Commands to list installed packages along with their versions and the name
# of the package manager, depending on the package managers.
# Each package manager is associated with a tuple, the first item being
# the package manager's command, the second being the arguments for the
# query (they must be separated for the "--entrypoint" argument of Docker
# 'run', see below), and the third one being the command that will format
# the output of the query command (this one can be an empty string in case
# the formatting part is already done using the options of the first command).
# The first command needs to be run on the container, and the second on the
# host, to take into account container images that do not have the formatting
# packages installed.
pkgmgr_cmd = {
"dpkg": ("dpkg", "-l", "awk 'NR>5 {print $2 \",\" $3 \",dpkg," + artifact_name + "," + timestamp + "\"}'"), \
"rpm":("rpm", "-qa --queryformat '%{NAME},%{VERSION},rpm," + artifact_name + "," + timestamp + "\\n'", ""), \
"pacman":("pacman", "-Q", "awk '{print $0 \",\" $1 \",pacman," + artifact_name + "," + timestamp + "\"}'"), \
"pip":("pip", "list", "awk 'NR>2 {print $1 \",\" $2 \",\" \"pip," + artifact_name + "," + timestamp + "\"}'"), \
"conda":("/root/.conda/bin/conda", "list -e", "sed 's/=/ /g' | awk 'NR>3 {print $1 \",\" $2 \",conda," + artifact_name + "," + timestamp + "\"}'")
}
# Command to obtain the latest commit hash in a git repository (separated
# into 2 parts for "--entrypoint"):
gitcmd = ("git", "log -n 1 --pretty=format:%H")
logging.info("Checking software environment")
pkglist_file = open(pkglist_path, "w")
# pkglist_file.write("package,version,package_manager\n")
path = os.path.join(src_dir, config["buildfile_dir"])
# Package managers:
pkglist_file = open("pkglist.csv", "w")
pkglist_file.write("Package,Version,Package manager\n")
path = os.path.join(src_dir, config["location"])
for pkgmgr in config["package_managers"]:
# "--entrypoint" requires command and arguments to be separated.
# This Docker 'run' option is used to prevent the shell from printing
# a login message, if any.
pkglist_cmd = pkgmgr_cmd[pkgmgr][0]
pkglist_cmdargs = pkgmgr_cmd[pkgmgr][1].split(" ")
listformat_cmd = pkgmgr_cmd[pkgmgr][2]
logging.info(f"Checking '{pkgmgr}'")
# pkglist_process = subprocess.run(["docker", "run", "--rm", config["image_name"]] + pkglist_cmd.split(" "), cwd=path, capture_output=True)
pkglist_process = subprocess.run(["docker", "run", "--rm", "--entrypoint", pkglist_cmd, artifact_name] + pkglist_cmdargs, cwd=path, capture_output=True)
format_process = subprocess.run(f"cat << EOF | {listformat_cmd}\n{pkglist_process.stdout.decode('utf-8')}EOF", cwd=path, capture_output=True, shell=True)
pkglist_process = subprocess.run(["docker", "run", "--rm", config["name"]] + pkgmgr_cmd[pkgmgr][0].split(" "), cwd=path, capture_output=True)
format_process = subprocess.run("cat << EOF | " + pkgmgr_cmd[pkgmgr][1] + "\n" + pkglist_process.stdout.decode("utf-8") + "EOF", cwd=path, capture_output=True, shell=True)
pkglist = format_process.stdout.decode("utf-8")
pkglist_file.write(pkglist)
# Python venvs:
logging.info("Checking Python venvs")
for venv in config["python_venvs"]:
pipcmd = pkgmgr_cmd["pip"][0]
pipcmd_args = pkgmgr_cmd["pip"][1]
pkglist_process = subprocess.run(["docker", "run", "--rm", "-w", venv["path"], "--entrypoint", venv["path"] + "/bin/" + pipcmd, artifact_name] + pipcmd_args.split(" "), cwd=path, capture_output=True)
format_process = subprocess.run(f"cat << EOF | {listformat_cmd}\n{pkglist_process.stdout.decode('utf-8')}EOF", cwd=path, capture_output=True, shell=True)
pkglist = format_process.stdout.decode("utf-8")
pkglist_file.write(pkglist)
# Git packages:
logging.info("Checking Git packages")
for repo in config["git_packages"]:
pkglist_process = subprocess.run(["docker", "run", "--rm", "-w", repo["location"], "--entrypoint", gitcmd[0], artifact_name] + gitcmd[1].split(" "), cwd=path, capture_output=True)
repo_row = f"{repo['name']},{pkglist_process.stdout.decode('utf-8')},git,{artifact_name},{timestamp}"
pkglist_file.write(f"{repo_row}\n")
# Misc packages:
logging.info("Checking miscellaneous packages")
for pkg in config["misc_packages"]:
logging.info(f"Downloading package {pkg['name']} from {pkg['url']}")
pkg_file = tempfile.NamedTemporaryFile()
pkg_path = pkg_file.name
pkg_hash = download_file(pkg["url"], pkg_path)
# Package hash will be an empty string if download failed:
pkg_row = f"{pkg['name']},{pkg_hash},misc,{artifact_name},{timestamp}"
pkglist_file.write(f"{pkg_row}\n")
if "git_packages" in config.keys():
logging.info("Checking Git packages")
for repo in config["git_packages"]:
pkglist_process = subprocess.run(["docker", "run", "--rm", "-w", repo["location"], config["name"]] + gitcmd.split(" "), cwd=path, capture_output=True)
repo_row = repo["name"] + "," + pkglist_process.stdout.decode("utf-8") + ",git"
pkglist_file.write(repo_row + "\n")
if "misc_packages" in config.keys():
logging.info("Checking packages obtained outside of a package manager or VCS")
for pkg in config["misc_packages"]:
logging.info(f"Downloading package {pkg["name"]} from {pkg["url"]}")
req = requests.get(pkg["url"])
pkg_file = tempfile.NamedTemporaryFile()
pkg_file.write(req.content)
pkglist_process = subprocess.run("sha256sum " + pkg_file.name + " | cut -zd ' ' -f 1", cwd=path, capture_output=True, shell=True)
pkg_row = pkg["name"] + "," + pkglist_process.stdout.decode("utf-8") + ",misc"
pkglist_file.write(pkg_row + "\n")
pkglist_file.close()
def remove_image(config, image_name):
def remove_image(config):
"""
Removes the Docker image given in 'config'.
Removes the Docker image given in 'config'.
Parameters
----------
config: dict
Parsed config file.
Parameters
----------
config: dict
Part of the parsed YAML config file concerning the Docker image
to remove.
image_name: str
Name of the Docker image.
Returns
-------
None
Returns
-------
None
"""
logging.info(f"Removing image '{image_name}'")
subprocess.run(["docker", "rmi", image_name], capture_output = True)
name = config["name"]
logging.info(f"Removing image '{name}'")
subprocess.run(["docker", "rmi", name])
def build_images(config, src_dir):
"""
Builds all Docker images specified in 'config', checks software
environment if build is successful, then removes the images.
Parameters
----------
config: dict
Parsed YAML config file.
src_dir: tempfile.TemporaryDirectory
The directory where the artifact is stored.
Returns
-------
None
"""
for image in config["dockerfiles"]:
# Creating an output directory for this specific container:
pathlib.Path(image["name"]).mkdir(parents=True, exist_ok=True)
os.chdir(image["name"])
successful_build = build_image(image, src_dir)
if successful_build:
check_env(image, src_dir)
remove_image(image)
def main():
# Paths:
config_path = ""
pkglist_path = "" # Package list being generated
buildstatus_path = "" # Status of the build process of the image, when it fails
arthashlog_path = "" # Log of the hash of the downloaded artifact
cache_dir = "" # Artifact cache directory, when using one. 'None' value indicates no cache.
use_cache = False
global output_path
# Command line arguments parsing:
parser = argparse.ArgumentParser(
prog = "ecg",
description =
"""
ECG is a program that automates software environment checking for scientific artifacts.
It is meant to be executed periodically to analyze variations in the software environment of the artifact through time.
"""
description = "ECG is a program that automates software environment checking for scientific artifacts. "
"It is meant to be executed periodically to analyze variations in the software environment of the artifact through time."
)
# parser.add_argument(
# '-v', '--verbose',
# action = 'store_true',
# help = "Shows more details on what is being done."
# )
parser.add_argument(
"config",
help = "The path to the configuration file of the artifact's Docker image."
help = "The path to either a single configuration file, or a directory containing multiple configuration files if using '-d'. "
"Note that all YAML files in this directory must be artifact configuration files."
)
parser.add_argument(
"-p", "--pkg-list",
help = "Path to the file where the package list generated by the program should be written.",
required = True
)
# parser.add_argument(
# "-l", "--log-path",
# help = "Path to the file where to log the output of the program.",
# required = True
# )
parser.add_argument(
"-b", "--build-status",
help = "Path to the file where to write the build status of the Docker image given in the configuration file.",
required = True
"-d", "--directory",
action = "store_true",
help = "Set this option to specify the path of a directory containing multiple configuration files instead of a single file."
)
parser.add_argument(
"-a", "--artifact-hash",
help = "Path to the file where to write the log of the hash of the downloaded artifact.",
required = True
)
parser.add_argument(
"-c", "--cache-dir",
help =
"""
Path to the cache directory, where artifacts that are downloaded will be stored for future usage.
If not specified, cache is disabled.
""",
required = False
),
parser.add_argument(
'--docker-cache',
action = 'store_true',
help = "Use cache for Docker 'build'."
"-o", "--output",
help = "Path to the output directory."
)
parser.add_argument('-v', '--verbose', action='store_true')
args = parser.parse_args()
# Setting up the paths of the outputs:
pkglist_path = args.pkg_list
buildstatus_path = args.build_status
arthashlog_path = args.artifact_hash
cache_dir = args.cache_dir
# log_path = "log.txt" # Output of the program
# log_path = args.log_path
# Creating the output files to avoid complaints from Snakemake about missing
# outputs...
pathlib.Path(pkglist_path).touch()
pathlib.Path(buildstatus_path).touch()
pathlib.Path(arthashlog_path).touch()
# Setting up the log:
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
# # Old version where the script writes its own log to the given file:
# print(f"Output will be stored in {log_path}")
# logging.basicConfig(filename = log_path, filemode = "w", format = '%(levelname)s: %(message)s', level = logging.INFO)
# if args.verbose:
# logging.getLogger().addHandler(logging.StreamHandler(sys.stdout))
# Parsing the input file including the configuration of the artifact's
# image:
config_path = args.config
status = ""
config_file = open(config_path, "r")
config = json.loads(config_file.read())
config_file.close()
dl_dir = None
# If not using cache, creates a temporary directory:
if cache_dir == None:
tmp_dir = tempfile.TemporaryDirectory()
dl_dir = tmp_dir.name
# Parsing the input YAML file(s) including the configuration of the
# artifact(s):
configs = {}
# If args.config is a directory:
if args.directory:
for f in os.listdir(args.config):
if os.path.isfile(f) and f.endswith(".yaml"):
config_file = open(f, "r")
configs[f] = yaml.safe_load(config_file)
config_file.close()
# If args.config is a simple file:
else:
use_cache = True
dl_dir = cache_dir
artifact_name = os.path.splitext(os.path.basename(config_path))[0]
artifact_dir = download_sources(config, arthashlog_path, dl_dir, use_cache, artifact_name)
# If download was successful:
if artifact_dir != "":
return_code, build_output = build_image(config, artifact_dir, artifact_name, args.docker_cache)
if return_code == 0:
status = "success"
check_env(config, artifact_dir, artifact_name, pkglist_path)
remove_image(config, artifact_name)
else:
status = builderror_identifier(build_output)
# Creates file if not already:
pathlib.Path(pkglist_path).touch()
# If download failed, we need to save the error to the build status log:
else:
logging.fatal("Artifact could not be downloaded!")
status = "artifact_unavailable"
# except Exception as err:
# # Handles any possible script's own crashes:
# formatted_err = str(''.join(traceback.format_exception(None, err, err.__traceback__)))
# log_file = open(log_path, "a")
# log_file.write(formatted_err)
# log_file.close()
# logging.error(formatted_err)
# status = "script_crash"
buildresult_saver(status, buildstatus_path, config_path)
config_file = open(args.config, "r")
configs[args.config] = yaml.safe_load(config_file)
config_file.close()
# Configuring output directory:
if args.output != None:
output_path = args.output
pathlib.Path(output_path).mkdir(parents=True, exist_ok=True)
os.chdir(output_path)
for c in configs:
logging.info(f"Working on {c}")
verbose = args.verbose
config = configs[c]
# Creating an output folder for this artifact:
pathlib.Path(os.path.splitext(c)[0]).mkdir(parents=True, exist_ok=True)
os.chdir(os.path.splitext(c)[0])
# Creating an output folder for this specific runtime:
now = datetime.datetime.now()
timestamp = str(datetime.datetime.timestamp(now))
pathlib.Path(timestamp).mkdir(parents=True, exist_ok=True)
os.chdir(timestamp)
# if verbose:
# logging.info(f"Output will be stored in {output}")
src_dir = download_sources(config)
build_images(config, src_dir.name)
if __name__ == "__main__":
main()

14
example.yaml Normal file
View File

@ -0,0 +1,14 @@
artifact_url: "https://example.com/artifact.zip"
type: "zip" # Possible values: zip, tgz
doi: "XX.XXXX/XXXXXXX.XXXXXXX"
image_name: "image1:version"
dockerfile_location: "path/to/docker/folder"
package_managers:
- "dpkg" # Possible values: dpkg, rpm, pacman, pip, conda
git_packages:
- name: "pkg1"
location: "path/to/git/repo"
misc_packages:
- name: "mpkg1"
url: "https://example.com/package1.zip"
type: "zip" # Possible values: zip, tgz

55
flake.lock generated
View File

@ -18,45 +18,6 @@
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1689068808,
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"kapack": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1718633852,
"narHash": "sha256-KVeKDdab2wMYMo60mEQHz8Dus4ddhxJ1HPCXzUt9ei8=",
"owner": "oar-team",
"repo": "nur-kapack",
"rev": "052fb35eb29228d9e4ea8afa09e9f0e390782cbd",
"type": "github"
},
"original": {
"owner": "oar-team",
"repo": "nur-kapack",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1701282334,
@ -76,7 +37,6 @@
"root": {
"inputs": {
"flake-utils": "flake-utils",
"kapack": "kapack",
"nixpkgs": "nixpkgs"
}
},
@ -94,21 +54,6 @@
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View File

@ -4,15 +4,12 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/23.11";
flake-utils.url = "github:numtide/flake-utils";
kapack.url = "github:oar-team/nur-kapack";
kapack.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, flake-utils, kapack }:
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
kapkgs = kapack.packages.${system};
in
{
devShells = {
@ -20,21 +17,10 @@
packages = with pkgs; [
snakemake
gawk
gnused
nickel
graphviz
# TODO separate into several shells
(python3.withPackages (ps: with ps; [
requests
kapkgs.execo
pyyaml
]))
(rWrapper.override { packages = with rPackages; [ tidyverse reshape2 ]; })
];
};
latex = pkgs.mkShell {
packages = with pkgs; [
texliveFull
rubber
];
};
};

View File

@ -1,24 +0,0 @@
#!/usr/bin/env Rscript
# Libraries:
library(reshape2)
library(tidyverse)
# Parsing command line arguments:
options = commandArgs(trailingOnly = TRUE)
plot_type = options[1]
input = options[2]
output = options[3]
table_header = options[-1:-2:-3]
pdf(output)
read_csv(input, col_names = table_header) %>%
mutate(timestamp = as_date(as_datetime(timestamp))) %>% # Formatting the date
melt(id.vars = "timestamp", variable.name = "category", value.name = "amount") %>% # Formatting the table to plot each category
{
if (plot_type == "bar")
ggplot(data = ., aes(x = timestamp, y = amount, fill = category)) + geom_bar(stat = "identity")
else if (plot_type == "line")
ggplot(data = ., aes(x = timestamp, y = amount)) + geom_line(aes(color = category))
}

View File

@ -1,298 +0,0 @@
\documentclass{article}
\usepackage[a4paper, margin=20mm]{geometry}
\usepackage{hyperref}
\usepackage[
datamodel=software
]{biblatex}
\usepackage{software-biblatex}
\usepackage{todonotes}
\addbibresource{references.bib}
\usepackage{listings}
\lstset{
basicstyle=\small\ttfamily,
%columns=flexible,
frame = single,
breaklines=true
}
\newcommand{\noteqg}{\todo[backgroundcolor=blue!10,bordercolor=blue,inline,caption={}]}
%\usepackage{amssymb}
\usepackage{booktabs}
%\usepackage{adjustbox}
\newcommand{\dfile}{\texttt{Dockerfile}}
\newcommand{\ecg}{\texttt{ecg.py}}
\newcommand{\eg}{\emph{e.g.,}}
\newcommand{\ie}{\emph{i.e.,}}
\title{Protocol: Study of the Longevity of \dfile s from Research Artifacts}
\begin{document}
\maketitle
\section{General Information}
\subsection{Title of the project}
\emph{Study of the Longevity of \dfile s from Research Artifacts}
\subsection{Current and Future Contributors}
\href{https://www.elsevier.com/researcher/author/policies-and-guidelines/credit-author-statement}{CRediT}
\begin{itemize}
\item \href{https://orcid.org/0009-0003-7645-5044}{Quentin \textsc{Guilloteau}}: Conceptualization, Methodology, Software, Data Curation, Supervision, Project administration
\item Antoine Waehren
\end{itemize}
\subsection{Description of the project}
This project aims to show the limitations of using Docker containers as a reliable reproducibility tool.
In particular, as Docker relies on non-reproducible tools, it is difficult to construct a \dfile\ that will rebuild the \emph{exact} same software environment in the future.
In this project, we will collect research artifacts coming from various scientific conferences containing \dfile s, rebuild them periodically, and observe the variation in the resulting software environments.
We will also catch any error that could occur during the building of the image.
\subsection{Related work from contributors}
\cite{acmrep24}
\section{Architecture}
\subsection{Nickel}\label{sec:nickel}
We use the Nickel configuration language to guarantee the correctness of the descriptions of the artifacts.
This allows us to catch potential errors or incoherencies, from the Data Curation phase, even before trying to build the artifacts.
The definition of the schema is archived on Software Heritage \cite{nickel_schema}.
\noindent\begin{minipage}{.49\textwidth}
\begin{lstlisting}[caption=\dfile]{Name}
FROM ubuntu
RUN apt-get update && apt-get install X Y Z
RUN git clone https://github.com/foo/bar
RUN cd bar; make
\end{lstlisting}
\end{minipage}
\hfill
\begin{minipage}{.49\textwidth}
\begin{lstlisting}[caption=Nickel]{Name}
{
version = "1.0",
artifact_url = "https://zenodo.org/record/XXXXXXX/files/code.tar.gz",
type = "tar",
doi = "XX.XXXX/XXXXXXX.XXXXXXX",
virtualization = "docker",
buildfile_dir = "path/to/dockerfile",
package_managers = [ "dpkg" ],
git_packages = [
{ name = "bar", location = "~/bar" }
],
}
\end{lstlisting}
\end{minipage}
\subsection{\ecg}
This Python script\ \cite{ecg_code} takes as input a (verified) JSON representation of the Nickel artifact description, and then tries to build the \dfile\ contained in the artifact.
\paragraph{Workflow}
\begin{enumerate}
\item Read the JSON description of the artifact
\item Download the artifact (Section \ref{sec:download})
\item Log the cryptographic hash of the downloaded artifact (Section \ref{sec:download})
\item Extract the artifact
\item Build the Docker image (Section \ref{sec:docker_build})
\item If the build is successful, gather information about the produced software environment (Sections \ref{sec:package_managers}, \ref{sec:git}, \ref{sec:misc}, and \ref{sec:pyenv})
\item If the build failed, gather information about the reason of the failure
\end{enumerate}
\noteqg{should probably be a flowgraph}
\subsubsection{Download of the Artifact}\label{sec:download}
The link to the to artifact is the link provided by the authors in their Artifact Description.
\ecg\ will use this link to download the artifact.
If the download is successful, \ecg\ will log the cryptographic hash of the content.
This allows us to also have information about the stability/longevity of the artifact sharing.
\subsubsection{Docker Build Statuses}\label{sec:docker_build}
\ecg\ captures different types of statuses for the build attempt of a \dfile:
\begin{itemize}
\item \texttt{baseimage\_unavailable}: the base image of the \dfile\ (\texttt{FROM} image) is not available.
\item \texttt{job\_time\_exceeded}: when running on a batch system such as OAR, this error indicates that the \dfile\ did not build under \emph{1 hour}
\item \texttt{success}: the \dfile\ has been built successfully
\item \texttt{package_install_failed}: a command requested the installation of a package that failed
\item \texttt{artifact_unavailable}: the artifact could not be downloaded
\item \texttt{dockerfile_not_found}: no \dfile\ has been found in the location specified in the configuration file
\item \texttt{script_crash}: an error has occurred with the script itself
\item \texttt{unknown_error}: the \dfile\ could not be built for an unknown reason
\end{itemize}
\subsubsection{Information from the Package Manager}\label{sec:package_managers}
Package Managers can provide information about the packages installed: package name and package version.
\paragraph{Supported Package Managers} \texttt{dpkg}, \texttt{rpm}, \texttt{pacman}, \texttt{pip}, \texttt{conda}
\paragraph{Example of Data}
Below is an example of data collected for the \texttt{gcc-8} package on a Ubuntu image:
\begin{lstlisting}
gcc-8,8.3.0-6,dpkg
\end{lstlisting}
First column is the name of the package, second is the version number given by the package manager, and third is the package manager. The actual outputs will also have a fourth column with the timestamp of when the package list was generated.
\subsubsection{Git repositories (\texttt{git})}\label{sec:git}
\dfile\ authors can also install packages from source.
One way to do this is via Git.
In this case, once the container built successfully, \ecg\ logs into the container and extracts the commit hash of the repository (via \texttt{git log}).
To be considered as a Git package, a package must have been downloaded using the \verb|git| command, and the repository's local directory should still have a \verb|.git| subdirectory. Otherwise, it should be considered as a \textit{misc} package, since the hash of the latest commit cannot be retrieved in that case (see below).
\paragraph{Example of Data}
Below is an example of data collected for a Git repository called \texttt{ctf}:
\begin{lstlisting}
ctf,c3f95829628c381dc9bf631c69f08a7b17580b53,git
\end{lstlisting}
First column is the name of the package, second is the cryptographic hash of the latest commit in the current branch of the Git repo (used as version number), and third is the package source (Git). The actual outputs will also have a fourth column with the timestamp of when the package list was generated.
\subsubsection{Downloaded content (\texttt{misc})}\label{sec:misc}
In the case where the \dfile\ downloads content from the internet (\eg\ archives, binaries), \ecg\ will download the same content on the host machine (\ie\ not in the container) and then compute the cryptographic hash of the downloaded content.
\paragraph{Example of Data}
Below is an example of data collected for the downloading of the \texttt{Miniconda3} binary:
\begin{lstlisting}
Miniconda3-py37_4.12.0-Linux-x86_64,4dc4214839c60b2f5eb3efbdee1ef5d9b45e74f2c09fcae6c8934a13f36ffc3e,misc
\end{lstlisting}
First column is the name of the package, second is the cryptographic hash of the downloaded content (used as version number), and third is the package source (misc). The actual outputs will also have a fourth column with the timestamp of when the package list was generated.
\subsubsection{Python Virtual Environment (\texttt{pyenv})}\label{sec:pyenv}
Even if \texttt{pip} is managed in the ``Package Managers'' section (Section \ref{sec:package_managers}), when authors use a virtual environment, \ecg\ needs to query this exact Python environment, and not the global one.
\subsection{Snakemake}
\subsection{R}
\section{Data collection}
\subsection{Has the data collection started?}
No.
\subsection{Considered Conferences}
\begin{table}
\centering
\begin{tabular}{lrr}
\toprule
Conference Name & Submission Date & Proceedings Publication Date\\
\midrule
EuroPar 2024 & March 2024 & September 2024\\
SuperComputing 2024 & April 2024 & November 2024 \\
\bottomrule
\end{tabular}
\caption{Considered Conferences and associated important dates}
\label{tab:conferences}
\end{table}
Table \ref{tab:conferences} summarizes the considered conferences and their important dates.
\noteqg{todo}
\subsection{Gathering of \dfile s}
The gathering part of the \dfile s will be done right after the publication of the proceeding of a conference.
Contributors of the ``Data Curation'' phase will go through all the papers and their artifact to extract artifact containing \dfile s.
These \dfile s will then be captured with the Nickel description (see Section \ref{sec:nickel}).
To avoid mistake, at least two contributors will be assigned by paper.
If there is any difference in the Nickel description of an artifact, a discussion between the contributors will be initiated to conclude on the correct artifact description.
\noteqg{can we do this in the workflow?}
\subsection{Building Periodicity}
The building workflow will be executed \emph{every month} for one year.
After one year, the workflow will be executed with increasing time intervals between execution.
\noteqg{TODO: A table/list/gantt chart of all the planned executions (dates)}
\section{Analysis}
One paragraph per plot
Any statistical tests?
\subsection{Static Analysis}
The first part of the analysis can be done statically from the description of the artifacts.
\begin{itemize}
\item Number/Proportion of \dfile s using particular package managers
\item Number/Proportion of \dfile s downloading content from Git repositories
\item Number/Proportion of \dfile s downloading content from internet
\end{itemize}
\subsection{Dynamic Analysis}
The second part of the analysis will be done after the first year of data collection, and will focus on the temporal evolution of properties of the artifacts.
\paragraph{Artifact Sources}
\begin{itemize}
\item Number/Proportion of artifacts that can be downloaded
\item Number/Proportion of artifacts which content has changed
\end{itemize}
\paragraph{Build Status}
\begin{itemize}
\item Number/Proportion of \dfile s that build successfully
\item Number/Proportion of \dfile s errors (\texttt{baseimage\_unavailable}, \texttt{job\_time\_execeed}, \texttt{unknown\_error}) for the failed builds
\end{itemize}
\paragraph{Software Environment}
\begin{itemize}
\item Number of installed packages per container
\item Number/Proportion of packages that changed version since last build
\item Package sources (package manager, Git, misc) from where packages are changing the most
\end{itemize}
\section{Other}
\subsection{Computational Environment}
The builds of the \dfile s will be executed on the french testbed Grid'5000 \cite{grid5000}.
\noteqg{TODO: Which cluster?}
The software environment will be managed by Nix \cite{dolstra2004nix}.
\noteqg{TODO: swh link to the shells in the repo}
\subsection{Environmental Cost}
\noteqg{TODO: do an estimation}
\subsection{Data and Source Code Long-term Availability}
The collected data will be stored on Zenodo.
The Source code will be archived on Software-Heritage.
\printbibliography
\end{document}

View File

@ -1,63 +0,0 @@
@inproceedings{acmrep24,
TITLE = {{Longevity of Artifacts in Leading Parallel and Distributed Systems Conferences: a Review of the State of the Practice in 2023}},
AUTHOR = {Guilloteau, Quentin and Ciorba, Florina M and Poquet, Millian and Goepp, Dorian and Richard, Olivier},
URL = {https://hal.science/hal-04562691},
BOOKTITLE = {{REP 2024 - ACM Conference on Reproducibility and Replicability}},
ADDRESS = {Rennes, France},
ORGANIZATION = {{ACM}},
PAGES = {1-14},
YEAR = {2024},
MONTH = Jun,
DOI = {10.1145/3641525.3663631},
KEYWORDS = {Empirical studies Reproducibility ; Artifact Evaluation ; Badges ; Longevity},
PDF = {https://hal.science/hal-04562691/file/rep24_longevity_artifacts.pdf},
HAL_ID = {hal-04562691},
HAL_VERSION = {v1},
}
@inproceedings{grid5000,
title={Adding virtualization capabilities to the Grid5000 testbed},
author={Balouek, Daniel and Amarie, Alexandra Carpen and Charrier, Ghislain and Desprez, Fr{\'e}d{\'e}ric and Jeannot, Emmanuel and Jeanvoine, Emmanuel and L{\`e}bre, Adrien and Margery, David and Niclausse, Nicolas and Nussbaum, Lucas and others},
booktitle={Cloud Computing and Services Science: Second International Conference, CLOSER 2012, Porto, Portugal, April 18-21, 2012. Revised Selected Papers 2},
pages={3--20},
year={2013},
organization={Springer}
}
@inproceedings{dolstra2004nix,
title={Nix: A Safe and Policy-Free System for Software Deployment.},
author={Dolstra, Eelco and De Jonge, Merijn and Visser, Eelco and others},
booktitle={LISA},
volume={4},
pages={79--92},
year={2004}
}
@software{ecg,
title = {{ecg.py}},
author = {Guilloteau, Quentin and Waehren, Antoine},
date = {2024},
license = {GPL-3.0},
url = {https://forge.chapril.org/GuilloteauQ/study-docker-repro-longevity},
repository= {https://forge.chapril.org/GuilloteauQ/study-docker-repro-longevity},
}
@codefragment{nickel_schema,
subtitle = {Nickel Artifact Schema},
swhid = {
swh:1:cnt:bc691d4b5c87458bff498223185b2956d182a766;
origin=https://forge.chapril.org/GuilloteauQ/study-docker-repro-longevity;
visit=swh:1:snp:e6702465c82c96864a6d4a49d51789f398a8a336;
anchor=swh:1:rev:114d0e58163d6e01152c683bddb0a7b79269d4fe;
path=/workflow/nickel/artifact_contract.ncl
},
crossref = {ecg}
}
@codefragment{ecg_code,
subtitle = {{ecg.py} Code source},
swhid = {
swh:1:cnt:7c7a8497fed8f31052ef9492a99862678a06d6d4;origin=https://forge.chapril.org/GuilloteauQ/study-docker-repro-longevity;visit=swh:1:snp:e6702465c82c96864a6d4a49d51789f398a8a336;anchor=swh:1:rev:114d0e58163d6e01152c683bddb0a7b79269d4fe;path=/ecg.py
},
crossref = {ecg}
}

16
test.yaml Normal file
View File

@ -0,0 +1,16 @@
artifact_url: "http://localhost/artifact.zip"
type: "zip"
doi: "XX.XXXX/XXXXXXX.XXXXXXX"
dockerfiles:
- name: "prog:latest"
location: "./"
package_managers:
- "dpkg"
- "pip"
git_packages:
- name: "pkg1"
location: "/pkg1"
misc_packages:
- name: "mpkg1"
url: "http://localhost/package1.zip"
type: "zip"

View File

@ -1,8 +0,0 @@
#!/bin/bash
cd ..
OUTPUT_PATH=output
CACHE_DIR=cache
rm -rf $OUTPUT_PATH $CACHE_DIR

View File

@ -1,11 +0,0 @@
#!/bin/bash
cd ..
ARTIFACT_NAME=$1
ARTIFACT_OUT="artifacts/json/$ARTIFACT_NAME.json"
ARTIFACT_IN="artifacts/nickel/$ARTIFACT_NAME.ncl"
CONTRACT="workflow/nickel/artifact_contract.ncl"
# nickel export --format json --output artifacts/json/$ARTIFACT.json workflow/nickel/artifact_contract.ncl artifacts/nickel/$ARTIFACT.ncl
nickel export --format json --output $ARTIFACT_OUT <<< 'let {Artifact, ..} = import "'$CONTRACT'" in ((import "'$ARTIFACT_IN'") | Artifact)'

View File

@ -1,18 +0,0 @@
#!/bin/bash
cd ..
OUTPUT_PATH=output
CACHE_DIR=cache
TESTFILE=$1
if [ ! -d $OUTPUT_PATH ]
then
mkdir $OUTPUT_PATH
fi
if [ ! -d $CACHE_DIR ]
then
mkdir $CACHE_DIR
fi
./ecg.py $TESTFILE -p $OUTPUT_PATH/pkglist.csv -b $OUTPUT_PATH/build_status.csv -a $OUTPUT_PATH/artifact_hash.csv -c $CACHE_DIR --docker-cache

View File

@ -1,234 +1,41 @@
configfile: "config/config.yaml"
include: "utils.smk"
import os
import datetime
DATE = datetime.datetime.now().strftime("%Y%m%d")
ARTIFACTS_FOLDER_NICKEL = config["folder_artifacts_nickel"]
ARTIFACTS_FOLDER_JSON = config["folder_artifacts_json"]
BLACKLIST_FOLDER = config["folder_blacklists"]
EXTENSION = "json"
SYSTEM = config["system"]
ARTIFACTS_FOLDER = "artifacts"
BLACKLIST_FOLDER = "blacklists"
BLACKLIST = "blacklist.csv"
EXTENSION = "yaml"
ARTIFACTS = get_artifacts_to_build(ARTIFACTS_FOLDER_NICKEL, BLACKLIST_FOLDER)
PREFIX = config["prefix"]
ECG_OUTPUTS = ["pkgs", "build_status", "artifact_hash"]
SHELLS_ECG = {
"local": f"./{{input.ecg_wrapper}} {{input.ecg}} {ARTIFACTS_FOLDER_JSON}/{{wildcards.artifact}}.{EXTENSION} {{output.pkg}} {{output.build_status}} {{output.artifact_hash}} {{output.log}}",
"g5k": f"python3 {{input.execo_wrapper}} --path {os.getcwd()} --script {{input.oar_wrapper}} --site {config['site']} --cluster {config['cluster']} --max-duration {config['max_duration']} --checkpoint {config['checkpoint']} {'--besteffort' if config['besteffort'] else ''} --sleep_time {config['sleep_time']} --build_status_file {{output.build_status}} --artifact {{wildcards.artifact}} -- '"
}
ANALYSIS_DIR = config["analysis_dir"]
ANALYSIS_CATS = ["sources_stats", "pkgs_changes", "build_status", "artifact"]
ANALYSIS_SCRIPTS_DIR = "analysis"
ANALYSIS_WRAPPER = "workflow/scripts/analysis_wrapper.sh"
AGGREGATE_WRAPPER = "workflow/scripts/aggregate_wrapper.sh"
ARTIFACT_ANALYSIS_DIRS = " ".join(expand(f"{PREFIX}/artifact_hash/{{artifact}}",
artifact = ARTIFACTS
))
SOFTENV_ANALYSIS_DIRS = " ".join(expand(f"{PREFIX}/pkgs/{{artifact}}",
artifact = ARTIFACTS
))
PLOT_DIR = config["plot_dir"]
PLOT_SCRIPT = "plot/plot.r"
PLOT_HEADERS = {
"softenv": "dpkg rpm pacman pip conda git misc",
"build_status": "success package_install_failed baseimage_unavailable artifact_unavailable dockerfile_not_found script_crash job_time_exceeded unknown_error",
"artifact": "available unavailable changed"
}
ARTIFACTS = get_artifacts_to_build(ARTIFACTS_FOLDER, BLACKLIST)
rule all:
input:
expand(f"{ANALYSIS_DIR}/{{analysis_cat}}/plot/line/{{date}}.pdf",
analysis_cat = ANALYSIS_CATS,
date = DATE
),
expand(f"{ANALYSIS_DIR}/{{analysis_cat}}/plot/bar/{{date}}.pdf",
analysis_cat = ["sources_stats", "build_status", "artifact"],
date = DATE
),
expand("{folder}/{artifact}/{date}.csv",\
folder=["logs", "pkgs", "status"],\
artifact=ARTIFACTS,\
date=DATE),
f"{BLACKLIST_FOLDER}/{DATE}.csv"
# Artifacts configuration files:
rule check_all:
input:
expand(f"{ARTIFACTS_FOLDER_JSON}/{{artifact}}.json", artifact=ARTIFACTS)
rule check_artifact:
input:
"flake.nix",
"flake.lock",
contract="workflow/nickel/artifact_contract.ncl",
artifact=f"{ARTIFACTS_FOLDER_NICKEL}/{{artifact}}.ncl"
output:
f"{ARTIFACTS_FOLDER_JSON}/{{artifact}}.json"
shell:
"""
nickel export --format json --output {output} <<< 'let {{Artifact, ..}} = import "{input.contract}" in ((import "{input.artifact}") | Artifact)'
"""
# ECG:
rule run_ecg:
input:
"flake.nix",
"flake.lock",
ecg="ecg.py",
ecg_wrapper="workflow/scripts/ecg_wrapper.sh",
execo_wrapper="workflow/scripts/submission_g5k.py",
oar_wrapper="workflow/scripts/ecg_oar_wrapper.oar.bash",
artifact=f"{ARTIFACTS_FOLDER_JSON}/{{artifact}}.{EXTENSION}"
output:
log = f"{PREFIX}/logs/{{artifact}}/{{date}}.txt",
pkg = f"{PREFIX}/pkgs/{{artifact}}/{{date}}.csv",
build_status = f"{PREFIX}/build_status/{{artifact}}/{{date}}.csv",
artifact_hash = f"{PREFIX}/artifact_hash/{{artifact}}/{{date}}.csv",
log = "logs/{artifact}/{date}.csv",
pkg = "pkgs/{artifact}/{date}.csv",
status = "status/{artifact}/{date}.csv",
shell:
(SHELLS_ECG["g5k"] if SYSTEM == "g5k" else "") + SHELLS_ECG["local"] + ("'" if SYSTEM == "g5k" else "")
f"python3 {{input.ecg}} --log {{output.log}} --pkg {{output.pkg}} --status {{output.pkg}} {ARTIFACTS_FOLDER}/{{wildcards.artifact}}.{EXTENSION}"
rule update_blacklist:
input:
build_status=expand(f"{PREFIX}/build_status/{{artifact}}/{{{{date}}}}.csv",
artifact=ARTIFACTS
)
BLACKLIST,
status=expand("status/{artifact}/{{date}}.csv",\
artifact=ARTIFACTS)
output:
f"{BLACKLIST_FOLDER}/{{date}}.csv"
shell:
# We need to ignore lines where build is successful:
f"cat {{input}} | grep -v ',success' > {{output}} || true"
# Analysis:
rule softenv_analysis:
wildcard_constraints:
date="\d+"
input:
expand(f"{PREFIX}/pkgs/{{artifact}}/{{{{date}}}}.csv",
artifact = ARTIFACTS
)
output:
sources_stats = f"{ANALYSIS_DIR}/sources_stats/{{date}}.csv",
pkgs_changes = f"{ANALYSIS_DIR}/pkgs_changes/{{date}}.csv"
shell:
f"""
{ANALYSIS_WRAPPER} files {ANALYSIS_SCRIPTS_DIR}/softenv_analysis.py -t sources-stats {{output.sources_stats}} {{input}}
{ANALYSIS_WRAPPER} dirs {ANALYSIS_SCRIPTS_DIR}/softenv_analysis.py -t pkgs-changes {{output.pkgs_changes}} {SOFTENV_ANALYSIS_DIRS}
"""
rule buildstatus_analysis:
wildcard_constraints:
date="\d+"
input:
expand(f"{PREFIX}/build_status/{{artifact}}/{{{{date}}}}.csv",
artifact = ARTIFACTS
),
output:
f"{ANALYSIS_DIR}/build_status/{{date}}.csv"
shell:
f"""
{ANALYSIS_WRAPPER} files {ANALYSIS_SCRIPTS_DIR}/buildstatus_analysis.py {{output}} {{input}}
"""
rule artifact_analysis:
wildcard_constraints:
date="\d+"
input:
expand(f"{PREFIX}/artifact_hash/{{artifact}}/{{{{date}}}}.csv",
artifact = ARTIFACTS
)
output:
f"{ANALYSIS_DIR}/artifact/{{date}}.csv"
shell:
f"""
{ANALYSIS_WRAPPER} dirs {ANALYSIS_SCRIPTS_DIR}/artifact_analysis.py {{output}} {ARTIFACT_ANALYSIS_DIRS}
"""
# Analysis aggregate:
rule analysis_aggregate:
input:
expand(f"{ANALYSIS_DIR}/{{cat}}/aggregated/{{date}}.csv",
cat = ANALYSIS_CATS,
date = DATE
)
rule pkgschgs_aggregate:
input:
f"{ANALYSIS_DIR}/pkgs_changes/{{date}}.csv"
output:
f"{ANALYSIS_DIR}/pkgs_changes/aggregated/{{date}}.csv"
shell:
f"{AGGREGATE_WRAPPER} {ANALYSIS_DIR}/pkgs_changes {{output}}"
rule srcsstats_aggregate:
input:
f"{ANALYSIS_DIR}/sources_stats/{{date}}.csv"
output:
f"{ANALYSIS_DIR}/sources_stats/aggregated/{{date}}.csv"
shell:
f"{AGGREGATE_WRAPPER} {ANALYSIS_DIR}/sources_stats {{output}}"
rule artifact_aggregate:
input:
f"{ANALYSIS_DIR}/artifact/{{date}}.csv"
output:
f"{ANALYSIS_DIR}/artifact/aggregated/{{date}}.csv"
shell:
f"{AGGREGATE_WRAPPER} {ANALYSIS_DIR}/artifact {{output}}"
rule buildstatus_aggregate:
input:
f"{ANALYSIS_DIR}/build_status/{{date}}.csv"
output:
f"{ANALYSIS_DIR}/build_status/aggregated/{{date}}.csv"
shell:
f"{AGGREGATE_WRAPPER} {ANALYSIS_DIR}/build_status {{output}}"
# Plot:
rule all_plot:
input:
expand(f"{ANALYSIS_DIR}/{{cat}}/aggregated/{{date}}.csv",
cat = ANALYSIS_CATS,
date = DATE
)
rule line_plot:
input:
sources_stats = f"{ANALYSIS_DIR}/sources_stats/aggregated/{{date}}.csv",
pkgs_changes = f"{ANALYSIS_DIR}/pkgs_changes/aggregated/{{date}}.csv",
build_status = f"{ANALYSIS_DIR}/build_status/aggregated/{{date}}.csv",
artifact = f"{ANALYSIS_DIR}/artifact/aggregated/{{date}}.csv"
output:
sources_stats = f"{ANALYSIS_DIR}/sources_stats/plot/line/{{date}}.pdf",
pkgs_changes = f"{ANALYSIS_DIR}/pkgs_changes/plot/line/{{date}}.pdf",
build_status = f"{ANALYSIS_DIR}/build_status/plot/line/{{date}}.pdf",
artifact = f"{ANALYSIS_DIR}/artifact/plot/line/{{date}}.pdf"
shell:
f"""
Rscript {PLOT_SCRIPT} line {{input.sources_stats}} {{output.sources_stats}} {PLOT_HEADERS["softenv"]} timestamp
Rscript {PLOT_SCRIPT} line {{input.pkgs_changes}} {{output.pkgs_changes}} {PLOT_HEADERS["softenv"]} timestamp
Rscript {PLOT_SCRIPT} line {{input.build_status}} {{output.build_status}} {PLOT_HEADERS["build_status"]} timestamp
Rscript {PLOT_SCRIPT} line {{input.artifact}} {{output.artifact}} {PLOT_HEADERS["artifact"]} timestamp
"""
rule bar_plot:
input:
sources_stats = f"{ANALYSIS_DIR}/sources_stats/aggregated/{{date}}.csv",
build_status = f"{ANALYSIS_DIR}/build_status/aggregated/{{date}}.csv",
artifact = f"{ANALYSIS_DIR}/artifact/aggregated/{{date}}.csv"
output:
sources_stats = f"{ANALYSIS_DIR}/sources_stats/plot/bar/{{date}}.pdf",
build_status = f"{ANALYSIS_DIR}/build_status/plot/bar/{{date}}.pdf",
artifact = f"{ANALYSIS_DIR}/artifact/plot/bar/{{date}}.pdf"
shell:
f"""
Rscript {PLOT_SCRIPT} bar {{input.sources_stats}} {{output.sources_stats}} {PLOT_HEADERS["softenv"]} timestamp
Rscript {PLOT_SCRIPT} bar {{input.build_status}} {{output.build_status}} {PLOT_HEADERS["build_status"]} timestamp
Rscript {PLOT_SCRIPT} bar {{input.artifact}} {{output.artifact}} {PLOT_HEADERS["artifact"]} timestamp
"""
f"cat {{input}} > {{output}} && ln -s {{output}} {BLACKLIST}"

View File

@ -1,102 +0,0 @@
let
conf = {
ARCHIVE_FORMATS = ["zip", "tar"],
PACKAGE_MANAGERS = ["dpkg", "rpm", "pacman", "pip", "conda"],
VIRT_TECHS = ["docker"],
FILEPATH_REGEX = "^[^\\x00]+$", # For UNIX, anything of length > 0 but without NULL characters, found at: https://stackoverflow.com/questions/537772/what-is-the-most-correct-regular-expression-for-a-unix-file-path
URL_REGEX = "^https?:\\/\\/(?:www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b(?:[-a-zA-Z0-9()@:%_\\+.~#?&\\/=]*)$", # Found at: https://uibakery.io/regex-library/url
IMAGENAME_REGEX = "^[a-z0-9]+(([.]{0,1}|[_]{0,2}|[-]*)[a-z0-9]+)*(:[a-zA-Z0-9_]+[a-zA-Z0-9._-]*){0,1}$", # Based on, with modifications: https://regexr.com/3bsog
VERNUMBER_REGEX = "[0-9]+(\\.([0-9])+)*"
}
in
{
PackageManager = std.contract.from_predicate (
fun value => std.array.any (fun x => x == value) conf.PACKAGE_MANAGERS
),
ArchiveType = std.contract.from_predicate (
fun value => std.array.any (fun x => x == value) conf.ARCHIVE_FORMATS
),
FilePath = std.contract.from_predicate (
fun value => std.string.is_match conf.FILEPATH_REGEX value
),
URL = std.contract.from_predicate (
fun value => std.string.is_match conf.URL_REGEX value
),
VersionNumber = std.contract.from_predicate (
fun value => std.string.is_match conf.VERNUMBER_REGEX value
),
VirtTech = std.contract.from_predicate (
fun value => std.array.any (fun x => x == value) conf.VIRT_TECHS
),
GitPackage = {
name
| doc "Name of the package for future identification"
| String,
location
| doc "Path where cloned in the container"
| FilePath
},
MiscPackage = {
name
| doc "Name of the package for future identification"
| String,
url
| doc "URL of the package. Will be used to compute the hash"
| URL
},
PythonVenv = {
path
| doc "Path to the Python venv."
| FilePath
},
Artifact = {
version
| doc "Version of the Nickel contract"
| optional
| String
| default = "1.0",
artifact_url
| doc "URL where to download the artifact"
| URL,
type
| doc "Type of the archive. Possible values: zip, tar"
| ArchiveType,
doi
| doc "DOI of the artifact"
| String,
conf_date
| doc "Date of the conference the artifact was published for"
| Number,
comment
| doc "Additional comments on the artifact that couldn't be written elsewhere"
| optional
| String
| default = "",
virtualization
| doc "Virtualization technology used in the artifact. Possible values: docker"
| VirtTech,
buildfile_dir
| doc "Path to the directory containing the file used to build the container in the artifact"
| FilePath,
package_managers
| doc "Package Managers used in the container. Possible values: dpkg, rpm, pacman, pip, conda"
| optional
| Array PackageManager
| default = [],
git_packages
| doc "Git repositories cloned in the container"
| optional
| Array GitPackage
| default = [],
misc_packages
| doc "Misc. packages downloaded from the container"
| optional
| Array MiscPackage
| default = [],
python_venvs
| doc "Python venvs created in the container"
| optional
| Array PythonVenv
| default = [],
}
}

View File

@ -1,8 +0,0 @@
#!/bin/bash
INPUT_DIR=$1
INPUT=$(find $INPUT_DIR/*.csv -maxdepth 1 -type f)
OUTPUT=$2
cat $INPUT > $OUTPUT

View File

@ -1,39 +0,0 @@
#!/bin/bash
MODE=$1 # Either "dirs" or "files", depending on the type of input
shift
SCRIPT=$1
shift
TYPE=""
if [ $1 = "-t" ]
then
TYPE=$2 # Used if softenv analysis
shift
OUTPUT=$2
shift
else
OUTPUT=$1
fi
shift
INPUT="$@"
# Adding option prefix:
if [ "$TYPE" != "" ]
then
TYPE="-t $TYPE"
fi
# If inputs are files, then we just use that as input for the script:
INPUT_FILES=$INPUT
# If inputs are directories, we need to explore every single one of them
# to find the input files to pass to the script:
if [ $MODE = "dirs" ]
then
INPUT_FILES=""
for dir in $INPUT
do
INPUT_FILES="$INPUT_FILES $(find $dir/*.csv -maxdepth 1 -type f)"
done
fi
python3 $SCRIPT $TYPE -i $INPUT_FILES -o $OUTPUT

View File

@ -1,25 +0,0 @@
#!/bin/bash
set -xe
DIRECTORY=$1
shift
BUILD_STATUS_FILE=$1
shift
ARTIFACT_FILE=$1
shift
# To "activate" nix on the node
export PATH=~/.local/bin:$PATH
# Install Docker on the node (-t is to store the images on /tmp because it has more disk)
# https://www.grid5000.fr/w/Docker
g5k-setup-docker -t
handler() {
echo "${ARTIFACT_FILE}, `date +%s.%N`, job_time_exceeded" >> ${BUILD_STATUS_FILE}; exit 0;
}
trap handler SIGUSR2
cd ${DIRECTORY}
nix develop --command $@

View File

@ -1,14 +0,0 @@
#!/bin/bash
ECG=$1
CONFIG=$2
PKGLIST=$3
BUILD_STATUS=$4
ARTHASH_LOG=$5
OUTPUT_LOG=$6
python3 $ECG -p $PKGLIST -b $BUILD_STATUS -a $ARTHASH_LOG $CONFIG > $OUTPUT_LOG 2> $OUTPUT_LOG
if [ $? -ne 0 ]
then
echo "${CONFIG}, `date +%s.%N`, script_crash" >> ${BUILD_STATUS}; exit 0;
fi

View File

@ -1,50 +0,0 @@
from execo_g5k import oardel, oarsub, OarSubmission, wait_oar_job_start, get_oar_job_nodes, get_oar_job_info
import time
import argparse
def submit_job(cluster, site, maximum_duration_minutes, checkpoint_minutes, is_besteffort, path, script, command, build_status_file, artifact):
reservation_duration = (maximum_duration_minutes + checkpoint_minutes) * 60
checkpoint = checkpoint_minutes * 60
job_type = []
if is_besteffort:
job_type.append("besteffort")
oar_job_id, _site = oarsub([(OarSubmission(f"{{cluster='{cluster}'}}/nodes=1",\
reservation_duration,\
job_type=job_type,\
additional_options=f"--checkpoint {checkpoint}",\
command=f"{path}/{script} {path} {build_status_file} {artifact} {command}"), site)])[0]
return oar_job_id
def wait_for_completion(oar_job_id, site, sleep_time):
state = "Running"
while state != "Terminated" and state != "Error":
time.sleep(sleep_time)
info = get_oar_job_info(oar_job_id, site)
state = info["state"]
def main():
parser = argparse.ArgumentParser(description="Wrapper script to submit to OAR from a namespace")
parser.add_argument("--site", required=True, help="Grid'5000 site to submit to")
parser.add_argument("--cluster", required=True, help="Cluster to submit to")
parser.add_argument("--max-duration", required=True, type=int, help="Max Duration in MINUTES of the docker build")
parser.add_argument("--checkpoint", required=True, type=int, help="Duration in MINUTES before the end of the job to do the checkpoint")
parser.add_argument("--besteffort", action='store_false', help="Submit the job as besteffort")
parser.add_argument("--path", required=True, help="Root of the project")
parser.add_argument("--script", required=True, help="Path of the bash script to oarsub relative to the '--path'")
parser.add_argument("--sleep_time", required=False, type=int, default=60, help="Time interval in seconds to check the termination of the job")
parser.add_argument("--build_status_file", required=True, help="File to write the build status to in the case of time exceeding")
parser.add_argument("--artifact", required=True, help="Name of the artifact")
parser.add_argument("command", help="ECG Command")
args = parser.parse_args()
oar_job_id = submit_job(args.cluster, args.site, args.max_duration, args.checkpoint, args.besteffort, args.path, args.script, args.command, args.build_status_file, args.artifact)
wait_oar_job_start(oar_job_id, args.site)
wait_for_completion(oar_job_id, args.site, args.sleep_time)
return 0
main()

View File

@ -1,23 +1,15 @@
import csv
import os
def get_blacklisted(blacklist_dir_path):
blacklisted = set()
if os.path.exists(blacklist_dir_path):
for blacklist in os.listdir(blacklist_dir_path):
if not os.path.isdir(blacklist):
blacklist_csv_path = os.path.join(blacklist_dir_path, blacklist)
with open(blacklist_csv_path, "r") as csv_file:
spamreader = csv.reader(csv_file, delimiter=",")
for row in spamreader:
blacklisted.add(row[0])
return blacklisted
def get_blacklisted_paths(blacklist_csv_path):
blacklisted = set()
with open(blacklist_csv_path, "r") as csv_file:
spamreader = csv.reader(csv_file, delimiter=",")
for row in spamreader:
blacklisted.add(row[0])
return blacklisted
def get_artifacts_to_build(artifacts_folder, blacklist_dir_path):
blacklisted = get_blacklisted(blacklist_dir_path)
all_artifacts = set([os.path.splitext(a)[0] for a in os.listdir(artifacts_folder) if not os.path.isdir(os.path.join(artifacts_folder, a))])
artifacts_to_build = list(all_artifacts.difference(blacklisted))
if artifacts_to_build != []:
return list(all_artifacts.difference(blacklisted))
else:
raise(Exception(f"There is no artifact to build! Either no artifact configuration files have been found, or they have all been blacklisted."))
def get_artifacts_to_build(artifacts_folder, blacklist_csv_path):
blacklisted = get_blacklisted_paths(blacklist_csv_path)
all_artifacts = set([a.split(".")[0] for a in os.listdir(artifacts_folder) if not os.path.isdir(os.path.join(artifacts_folder, a))])
return list(all_artifacts.difference(blacklisted))