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

ContentSets repo file not being copied into image w/o --redhat #491

Closed
jmtd opened this issue Apr 23, 2019 · 2 comments

Comments

Projects
2 participants
@jmtd
Copy link
Contributor

commented Apr 23, 2019

Describe the bug
When building an image that uses content_sets with cekit 3.0.0 on Fedora 29 wtih the podman back end, the .repo file for the ContentSets is not getting copied into the image, unless you also specify --redhat to cekit.

To reproduce
This is this image, develop branch, commit b8f0c0db0e08ef137b984f1aac411555a5a54bc0

(3.0.0) [jdowland@brick openjdk]$ cekit build --overrides-file rhel7-jdk8-overrides.yaml podman
2019-04-23 14:59:00,807 cekit        INFO     You are running on known platform: Fedora 29 (Workstation Edition)
2019-04-23 14:59:00,875 cekit        INFO     Generating files for podman engine
2019-04-23 14:59:00,880 cekit        INFO     Initializing image descriptor...
2019-04-23 14:59:00,892 cekit        INFO     Preparing resource 'cct_module'
2019-04-23 14:59:04,007 cekit        WARNING  The image has ContentSets repositories specified, all other repositories are removed!
2019-04-23 14:59:04,013 cekit        INFO     Handling artifacts...
2019-04-23 14:59:04,013 cekit        INFO     Preparing resource 'hawkular-javaagent'
2019-04-23 14:59:04,032 cekit        INFO     Preparing resource 'jolokia-jvm-1.5.0.redhat-1-agent.jar'
2019-04-23 14:59:04,033 cekit        INFO     Preparing resource 'jmx_prometheus_javaagent'
2019-04-23 14:59:04,034 cekit        INFO     Rendering Dockerfile...
2019-04-23 14:59:04,073 cekit        INFO     Building container image...
STEP 1: FROM rhel7:7-released
STEP 2: USER root
--> Using cache 2b7e2e9722ed00fa4d9e8a0d11881dbfe1dd0c9823f963a45075ca3da6967bf4
STEP 3: FROM 2b7e2e9722ed00fa4d9e8a0d11881dbfe1dd0c9823f963a45075ca3da6967bf4
STEP 4: RUN yum makecache
Loaded plugins: ovl, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 To enable Red Hat Subscription Management repositories:
     subscription-manager repos --enable <repo>
 To enable custom repositories:
     yum-config-manager --enable <repo>
Error: error building at step {Env:[PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin container=oci] Command:run Args:[yum makecache] Flags:[] Attrs:map[] Message:RUN yum makecache Original:RUN yum makecache}: error while running runtime: exit status 1
2019-04-23 14:59:05,731 cekit        ERROR    Image build failed, see logs above.
(3.0.0) [jdowland@brick openjdk]$ podman run --rm -ti 2b7e2e9722ed00fa4d9e8a0d11881dbfe1dd0c9823f963a45075ca3da6967bf4 ls /etc/yum.repos.d
redhat.repo

Expected behavior
There should be an additional .repo file in /etc/yum.repos.d corresponding to the ODCS content sets, OR a fatal error that content sets are not supported w/o --redhat being specified.

@jmtd jmtd added the type/bug label Apr 23, 2019

@jmtd jmtd changed the title ContentSets repo file not being copied into image ContentSets repo file not being copied into image w/o --redhat Apr 23, 2019

@goldmann

This comment has been minimized.

Copy link
Contributor

commented Apr 24, 2019

I can see three problems here:

  1. You are trying to build a RHEL image without the --redhat switch which is just a mistake.
  2. The tool says that content sets are used, but it does not even try to apply them in case of local builders
  3. ODCS support is missing in local builders other than Docker

What the tool should do is to request an ODCS compose using the community ODCS service, which is running in the Fedora infrastructure. This would eventually result in a failure, because the content sets defined in your case won't be found there. Which is perfectly fine, and expected.

The solution for this issue would be to request ODCS compose and fail in case the compose cannot be created. Log message should be added which ODCS server is used to make easier to spot problems like the missing --redhat switch.

goldmann added a commit to goldmann/cekit that referenced this issue Apr 24, 2019

ODCS compose enhancements
Fixes a few things:

1. Makes it possible to request ODCS composes for local builder
   other than Docker
2. Makes it possible to request ODCS compose using community service

Fixes cekit#491
@goldmann

This comment has been minimized.

Copy link
Contributor

commented Apr 24, 2019

A proposed fix is available in #497.

@goldmann goldmann added this to the Release 3.0.1 milestone Apr 24, 2019

@goldmann goldmann added this to To do in Release 3.0.1 via automation Apr 24, 2019

@goldmann goldmann self-assigned this Apr 24, 2019

@goldmann goldmann moved this from To do to In progress in Release 3.0.1 Apr 24, 2019

Release 3.0.1 automation moved this from In progress to Done Apr 26, 2019

goldmann added a commit that referenced this issue Apr 26, 2019

ODCS compose enhancements
Fixes a few things:

1. Makes it possible to request ODCS composes for local builder
   other than Docker
2. Makes it possible to request ODCS compose using community service

Fixes #491

goldmann added a commit that referenced this issue Apr 30, 2019

ODCS compose enhancements
Fixes a few things:

1. Makes it possible to request ODCS composes for local builder
   other than Docker
2. Makes it possible to request ODCS compose using community service

Fixes #491
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.