Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved manifest #11

Merged
merged 39 commits into from
Jun 13, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7a94ecd
Getting started on the improved manifest.
haz May 24, 2020
8a197d6
Initial draft of a package template.
haz May 25, 2020
5320d8a
Finished the initial config for the new package format.
haz May 26, 2020
284e0a5
Added some generic planutils directory variable.
haz May 27, 2020
00c015c
Updating the fast-downward shortcode.
haz May 27, 2020
ba451db
Redirect for the run scripts.
haz May 27, 2020
6527346
Changing image extension and simplifying singularity example.
haz May 27, 2020
4f61025
Renaming fd -> downward
haz May 27, 2020
26b6331
Minor bug.
haz May 27, 2020
b3efa88
Shift to packages.
haz May 28, 2020
bfa7c70
Manifest fix.
haz May 28, 2020
f996c1f
Some bug fixes and filename change.
haz May 28, 2020
4ddefc0
Put in the settings, and recording what is installed.
haz May 29, 2020
9b87f4c
Version bump and docker fix.
haz May 30, 2020
ac44d53
Added uninstall functionality.
haz May 30, 2020
ac84c2e
Improved parsing with subcommands.
haz Jun 4, 2020
03fe6de
Improved redirect script for installable packages.
haz Jun 4, 2020
b1b82e7
Small bug fix.
haz Jun 4, 2020
46dc0e5
Only create new command-line utilities for runnable packages.
haz Jun 4, 2020
c8b367b
Improved handling of the dependency mapping.
haz Jun 4, 2020
f041490
Making lama lama
haz Jun 4, 2020
a0b4509
Cleanup.
haz Jun 4, 2020
58115c5
Confirm installation of all (recursively computed) dependencies.
haz Jun 5, 2020
6a15d1d
Rollback failed installation process.
haz Jun 5, 2020
3890887
Collect & delete (after confirmation) all of the dependencies requested
haz Jun 5, 2020
c676dcb
Minor output touchup and allow for setup to be forced.
haz Jun 5, 2020
1595111
Fixing bug with main installation call.
haz Jun 5, 2020
a930f8e
Adding upgrade functionality.
haz Jun 5, 2020
c40829b
Improved display of installed/available packages.
haz Jun 5, 2020
c629d07
Better return codes and function naming.
haz Jun 6, 2020
54a6f27
Fixing bug with bash scripts.
haz Jun 6, 2020
6533802
Simplify the installation check using return codes.
haz Jun 6, 2020
eb5bd2a
Allow for installing/uninstalling multiple packages.
haz Jun 6, 2020
87f659d
Make sure packages are set up properly.
haz Jun 6, 2020
be1c2b9
Requiring an estimated size, and outputting a predicted size on install
haz Jun 6, 2020
ffb00f9
Refactored the size config name.
haz Jun 6, 2020
660260f
Minor fixes to the default behaviour of uninstalled package scripts.
haz Jun 7, 2020
6f90676
Optionally iterate through packages that may be no longer required.
haz Jun 7, 2020
150b7e3
Fixing a couple of bugs.
haz Jun 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions planutils/package_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def check_package(target, manifest):
assert os.path.exists(manifest), "Error: Manifest must be defined for %s" % target
with open(manifest, 'r') as f:
config = json.load(f)
for key in ['name', 'description', 'dependencies']:
for key in ['name', 'description', 'dependencies', 'size']:
assert key in config, "Error: Manifest for %s must include '%s'" % (base, key)


Expand Down Expand Up @@ -114,16 +114,23 @@ def install(targets):
to_install.reverse()

if to_install:
print("\nAbout to install the following packages: %s" % ', '.join(to_install))
to_install_desc = ["%s (%s)" % (pkg, PACKAGES[pkg]['size']) for pkg in to_install]
print("\nAbout to install the following packages: %s" % ', '.join(to_install_desc))
if input(" Proceed? [Y/n] ").lower() in ['', 'y', 'yes']:
installed = []
for package in to_install:
print("Installing %s..." % package)
package_path = os.path.join(CUR_DIR, 'packages', package)
print("Installing %s..." % package, end='')
try:
installed.append(package)
subprocess.check_call('./install', cwd=os.path.join(CUR_DIR, 'packages', package))
subprocess.check_call('./install', cwd=package_path)
size = subprocess.check_output('du -sh .',
cwd=package_path,
shell=True,
encoding='utf-8').split('\t')[0]
print("done. (size: %s)" % size)
haz marked this conversation as resolved.
Show resolved Hide resolved
except subprocess.CalledProcessError:
print("Error installing %s. Rolling back changes..." % package)
print("\nError installing %s. Rolling back changes..." % package)
for p in installed:
subprocess.call('./uninstall', cwd=os.path.join(CUR_DIR, 'packages', p))
return False
Expand Down
1 change: 1 addition & 0 deletions planutils/packages/TEMPLATE/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "Full name of package",
"description": "General description of the package",
"size": "unknown",
"dependencies": ["list", "of", "dependencies"]
}
haz marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions planutils/packages/downward/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "Fast Downward",
"description": "http://fast-downward.org/",
"size": "36M",
"dependencies": []
}
1 change: 1 addition & 0 deletions planutils/packages/lama/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "LAMA",
"description": "http://fast-downward.org/",
"size": "20K",
"dependencies": ["downward"]
}