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

OSBS builder doesn't work well with plain artifacts with target set #414

Closed
goldmann opened this issue Mar 1, 2019 · 3 comments

Comments

Projects
None yet
1 participant
@goldmann
Copy link
Contributor

commented Mar 1, 2019

It uses the name attribute instead of target if available.

@goldmann goldmann added this to the 2.2.7 milestone Mar 1, 2019

@goldmann goldmann self-assigned this Mar 3, 2019

@goldmann

This comment has been minimized.

Copy link
Contributor Author

commented Mar 4, 2019

Full traceback:

Traceback (most recent call last):
  File "/usr/bin/cekit", line 11, in <module>
    load_entry_point('cekit==2.2.6', 'console_scripts', 'cekit')()
  File "/usr/lib/python3.7/site-packages/cekit/cli.py", line 289, in run
    Cekit().parse().run()
  File "/usr/lib/python3.7/site-packages/cekit/cli.py", line 255, in run
    builder.prepare(generator.image)
  File "/usr/lib/python3.7/site-packages/cekit/builders/osbs.py", line 94, in prepare
    self.update_osbs_image_source()
  File "/usr/lib/python3.7/site-packages/cekit/builders/osbs.py", line 119, in update_osbs_image_source
    artifact))
  File "/usr/lib64/python3.7/shutil.py", line 245, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib64/python3.7/shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: 'target/image/jboss-dv-6.4.6-patch'
@goldmann

This comment has been minimized.

Copy link
Contributor Author

commented Mar 4, 2019

And similar traceback from development branch:

Traceback (most recent call last):
  File "/home/goldmann/git/redhat/cekit/venv/bin/cekit", line 11, in <module>
    load_entry_point('cekit', 'console_scripts', 'cekit')()
  File "/home/goldmann/git/redhat/cekit/cekit/cli.py", line 309, in run
    Cekit().parse().run()
  File "/home/goldmann/git/redhat/cekit/cekit/cli.py", line 270, in run
    builder.prepare(self.generator.image)
  File "/home/goldmann/git/redhat/cekit/cekit/builders/osbs.py", line 130, in prepare
    self.update_osbs_image_source()
  File "/home/goldmann/git/redhat/cekit/cekit/builders/osbs.py", line 155, in update_osbs_image_source
    artifact))
  File "/home/goldmann/git/redhat/cekit/venv/lib64/python3.6/shutil.py", line 245, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/home/goldmann/git/redhat/cekit/venv/lib64/python3.6/shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: 'target/image/jboss-dv-6.4.6-patch'
@goldmann

This comment has been minimized.

Copy link
Contributor Author

commented Mar 4, 2019

The issue is in these lines:

self.artifacts = [a['name']
for a in descriptor.all_artifacts if not isinstance(a, _PlainResource)]
# When plain artifact was handled using lookaside cache, we need to add it too
# TODO Rewrite this!
self.artifacts += [a['name']
for a in descriptor.all_artifacts if isinstance(a, _PlainResource) and a.get('lookaside')]
. These have hardcoded name key. Instead, this function should be used:
def target_file_name(self):
if 'target' not in self:
self['target'] = os.path.basename(self.name)
return self['target']

goldmann added a commit to goldmann/cekit that referenced this issue Mar 4, 2019

Properly define what artficats should be copied to dist-git
The issue was that if an artifact had the 'target' kwy set,
the OSBS builder incorrectly skipped it and tried to use 'name'.

Fixes cekit#414

goldmann added a commit to goldmann/cekit that referenced this issue Mar 4, 2019

Properly define what artficats should be copied to dist-git
The issue was that if an artifact had the 'target' kwy set,
the OSBS builder incorrectly skipped it and tried to use 'name'.

Fixes cekit#414

@goldmann goldmann closed this in #416 Mar 4, 2019

goldmann added a commit that referenced this issue Mar 4, 2019

Properly define what artficats should be copied to dist-git
The issue was that if an artifact had the 'target' kwy set,
the OSBS builder incorrectly skipped it and tried to use 'name'.

Fixes #414

goldmann added a commit to goldmann/cekit that referenced this issue Mar 4, 2019

Properly define what artficats should be copied to dist-git
The issue was that if an artifact had the 'target' kwy set,
the OSBS builder incorrectly skipped it and tried to use 'name'.

Fixes cekit#414
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.