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

container build failing in OpenShift 3.9 #320

Closed
miabbott opened this issue Feb 5, 2019 · 6 comments
Closed

container build failing in OpenShift 3.9 #320

miabbott opened this issue Feb 5, 2019 · 6 comments
Assignees
Labels
jira for syncing to jira

Comments

@miabbott
Copy link
Member

miabbott commented Feb 5, 2019

On our internal OpenShift 3.9 instance, there is a BuildConfig defined for building the coreos-assembler container. It built successfully from 4bbdbba a few days ago, but when I try to build it again today, it is failing.

The BuildConfig looks like this:

$ /usr/local/bin/oc get bc/coreos-assembler -o yaml                                                                                                                                              
apiVersion: build.openshift.io/v1
kind: BuildConfig
spec:
  failedBuildsHistoryLimit: 5
  nodeSelector: {}
  output:
    to:
      kind: ImageStreamTag
      name: coreos-assembler:latest
  postCommit: {}
  resources:
    limits:
      memory: 4000Mi
  runPolicy: Serial
  source:
    git:
      ref: master
      uri: https://github.com/coreos/coreos-assembler
    type: Git
  strategy:
    dockerStrategy:
      from:
        kind: ImageStreamTag
        name: fedora:29
        namespace: redhat-coreos
    type: Docker
  successfulBuildsHistoryLimit: 5
  triggers: []
status:
  lastVersion: 2

The failing part of the build:

Removing intermediate container f5240a0e9da3
Step 7/16 : RUN ./build.sh write_archive_info
 ---> Running in 48555f5281ac
++ pwd
+ srcdir=/root/containerbuild
+ write_archive_info
+ . /root/containerbuild/src/cmdlib.sh
++ set -euo pipefail
+++ dirname ./build.sh
++ DIR=.
++ RFC3339=%Y-%m-%dT%H:%M:%SZ
++ export PYTHONUNBUFFERED=1
++ PYTHONUNBUFFERED=1
++ grep -q '^Fedora' /etc/redhat-release
++ export ISFEDORA=1
++ ISFEDORA=1
++ export ISEL=
++ ISEL=
++ _privileged=
+ mkdir -p /cosa /lib/coreos-assembler
+ touch -f /lib/coreos-assembler/.clean
+ prepare_git_artifacts /root/containerbuild /cosa/coreos-assembler-git.tar.gz /cosa/coreos-assembler-git.json
+ local gitd=/root/containerbuild
+ shift
+ local tarball=/cosa/coreos-assembler-git.tar.gz
+ shift
+ local json=/cosa/coreos-assembler-git.json
+ shift
+ local is_dirty=false
+ local head_ref=unknown
+ local head_remote=unknown
+ local head_url=unknown
+ local 'gc=git --work-tree=/root/containerbuild --git-dir=/root/containerbuild/.git'
+ git --work-tree=/root/containerbuild --git-dir=/root/containerbuild/.git diff --quiet --exit-code
Not a git repository
To compare two paths outside a working tree:
usage: git diff [--no-index] <path> <path>
+ is_dirty=true
+ tar -C /root/containerbuild -czf /cosa/coreos-assembler-git.tar.gz --exclude-vcs .
+ chmod 0444 /cosa/coreos-assembler-git.tar.gz
+ local rev
+ local branch
++ git --work-tree=/root/containerbuild --git-dir=/root/containerbuild/.git rev-parse HEAD
fatal: not a git repository: '/root/containerbuild/.git'
+ rev=
Removing intermediate container 48555f5281ac
error: build error: The command '/bin/sh -c ./build.sh write_archive_info' returned a non-zero code: 128
error: the build redhat-coreos/micah-coreos-assembler-2 status is "Failed"

@darkmuggle this looks like it is part of the changes you did for prepare_git_artifacts

@dustymabe dustymabe added the jira for syncing to jira label Feb 6, 2019
@miabbott
Copy link
Member Author

miabbott commented Feb 6, 2019

I thought about this some more after submitting it and I wonder if there is something happening in OpenShift that requires us to tweak the BuildConfig.

@cgwalters
Copy link
Member

I think an issue is actually that OpenShift builds by default don't give you the git repository inside the build. (But you do get those labels outside) There's an issue for this somewhere...

@darkmuggle
Copy link
Contributor

@cgwalters you are correct, and you commented on the issue actually:
openshift/source-to-image#457

Looking at a work around.

@miabbott
Copy link
Member Author

miabbott commented Feb 6, 2019

Laughing at the fact that we solved this previously in #28 😆

@darkmuggle
Copy link
Contributor

PR submitted. Pending acceptance. Testing in Quay showed it works as expected.

@darkmuggle
Copy link
Contributor

Closing this out, PR was merged.

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

No branches or pull requests

4 participants