Skip to content
This repository has been archived by the owner on Jun 10, 2019. It is now read-only.

Provide an absolute path to a debootstrap tarball #424

Open
mengelmann opened this issue Dec 23, 2017 · 5 comments
Open

Provide an absolute path to a debootstrap tarball #424

mengelmann opened this issue Dec 23, 2017 · 5 comments

Comments

@mengelmann
Copy link
Contributor

Hi,

while using tarball: true in manifest file bootstrap-vz returns a debootstrap error E: Tarball must be given a complete path. Debootstrap expects an absolute path to tarball while bootstrap-vz provides relative path.

Bootstrap-vz should provide an absolute path to a debootstrap tarball.

Details:

As described in http://bootstrap-vz.readthedocs.io/en/master/manifests/index.html debootstrap can then be pointed at a tarball and use it instead of downloading packages from the internet.

bootstrapper:
  workspace: ./dist
  tarball: true

Running bootstrap-vz with the manifest that contains tarball: true returns an error:

[...]
Installing Debian
Command 'debootstrap --arch=amd64 --include=locales --unpack-tarball=./dist/debootstrap-6c80f35a.tar stretch ./dist/e190f459/root http://deb.debian.org/debian/' returned non-zero exit status 1
Traceback (most recent call last):
  File "/home/users/mengelmann/bootstrap-vz/bootstrapvz/base/main.py", line 111, in run
    tasklist.run(info=bootstrap_info, dry_run=dry_run)
  File "/home/users/mengelmann/bootstrap-vz/bootstrapvz/base/tasklist.py", line 44, in run
    task.run(info)
  File "/home/users/mengelmann/bootstrap-vz/bootstrapvz/common/tasks/bootstrap.py", line 84, in run
    log_check_call(executable + options + arguments)
  File "/home/users/mengelmann/bootstrap-vz/bootstrapvz/common/tools.py", line 13, in log_check_call
    raise e
CalledProcessError: Command 'debootstrap --arch=amd64 --include=locales --unpack-tarball=./dist/debootstrap-6c80f35a.tar stretch ./dist/e190f459/root http://deb.debian.org/debian/' returned non-zero exit status 1
Rolling back
Unmounting the bootstrap volume
[...]

Running debotstrap directly with given options returns an error "E: Tarball must be given a complete path". Link to debootstrap source code https://anonscm.debian.org/cgit/d-i/debootstrap.git/tree/debootstrap#n530

$ sudo debootstrap --arch=amd64 --include=locales --unpack-tarball=./dist/debootstrap-6c80f35a.tar stretch ./dist/e190f459/root http://deb.debian.org/debian/
E: Tarball must be given a complete path
@andsens
Copy link
Owner

andsens commented Dec 24, 2017

Hm, I think what we need to do here is fix how the workspace path is handled. I never thought of using a relative path for that part. To keep things consistent, I think we should simultaneously make the workspace path relative to the manifest, like we do with a lot of other paths in the manifest.

@mengelmann
Copy link
Contributor Author

@andsens sorry for the delay.

You are right - debootstrap finds tarball just fine while using a relative path for workspace in a manifest file.

In my opinion, we should prefer a relative path instead of an absolute path.

Our use case is as follows:

  • we have manifest files in a private git repository
  • many DevOps may use the manifest files to develop and build images
  • many DevOps may work on single dev machine (VM)
  • CI system builds images as well

So:

  • the hardcoded absolute path within a home directory is not possible
  • the hardcoded absolute path out of a home directory (e.g. /target) may conflict when used multiple users

Making workspace path relative to the manifest as you suggested looks great for me (consistency and no need for absolute paths).

@mengelmann
Copy link
Contributor Author

Other issue related to relative/absolute paths #368.

@mengelmann
Copy link
Contributor Author

@andsens I can try to prepare PR for this issue, but please give me some hints how you would like to get the workspace path relative to the manifest done.

@andsens
Copy link
Owner

andsens commented Jan 21, 2018

please give me some hints how you would like to get the workspace path relative to the manifest done.

Oh, that's easy. Just use rel_path like all other tasks do. Give it info.manifest.path as the first arg and the relative path in question as the second one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants