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

Using commit hash instead of master #3

Merged
merged 2 commits into from
Mar 26, 2016
Merged

Conversation

ocefpaf
Copy link
Member

@ocefpaf ocefpaf commented Mar 25, 2016

Closes #2

@ocefpaf
Copy link
Member Author

ocefpaf commented Mar 25, 2016

Not sure what is going on with CircleCI (it builds locally using the same docker image BTW):

Traceback (most recent call last):
  File "/opt/conda/bin/conda-build", line 5, in <module>
    sys.exit(main())
  File "/opt/conda/lib/python3.5/site-packages/conda_build/main_build.py", line 194, in main
    args_func(args, p)
  File "/opt/conda/lib/python3.5/site-packages/conda_build/main_build.py", line 478, in args_func
    args.func(args, p)
  File "/opt/conda/lib/python3.5/site-packages/conda_build/main_build.py", line 423, in execute
    include_recipe=args.include_recipe)
  File "/opt/conda/lib/python3.5/site-packages/conda_build/build.py", line 417, in build
    m.parse_again(permit_undefined_jinja=False)
  File "/opt/conda/lib/python3.5/site-packages/conda_build/metadata.py", line 351, in parse_again
    self.meta = parse(self._get_contents(permit_undefined_jinja))
  File "/opt/conda/lib/python3.5/site-packages/conda_build/metadata.py", line 628, in _get_contents
    env.globals.update(context_processor(self, path))
  File "/opt/conda/lib/python3.5/site-packages/conda_build/jinja_context.py", line 65, in context_processor
    ctx = get_environ(m=initial_metadata)
  File "/opt/conda/lib/python3.5/site-packages/conda_build/environ.py", line 185, in get_dict
    m.get_value('source/git_rev')))
  File "/opt/conda/lib/python3.5/site-packages/conda_build/environ.py", line 74, in get_git_build_info
    assert "conda-bld/git_cache" in cache_dir

AssertionError ./ci_support/run_docker_build.sh returned exit code 1

@ocefpaf
Copy link
Member Author

ocefpaf commented Mar 25, 2016

Same failure trying to check the released version 😒

@ocefpaf ocefpaf force-pushed the sha branch 2 times, most recently from fd860e2 to 1b5e4c0 Compare March 25, 2016 16:10
@ocefpaf
Copy link
Member Author

ocefpaf commented Mar 25, 2016

@msarahan do you have any idea if there is something wrong with the recipe or if this is a conda-build bug? I got nothing but it was working before 😭

@msarahan
Copy link
Member

Sorry, no ideas right off the bat. @stuarteberg might have some ideas. He has been pretty deeply involved in that bit of conda-build.

@ocefpaf
Copy link
Member Author

ocefpaf commented Mar 25, 2016

Thanks @msarahan!

@stuarteberg
Copy link

I'm away from my computer until Tuesday.

@ocefpaf ocefpaf force-pushed the sha branch 13 times, most recently from 3af097d to 6005958 Compare March 25, 2016 20:11
@pelson
Copy link
Member

pelson commented Mar 26, 2016

I can reproduce this @ocefpaf. Just update your docker image. The problem is that we have the latest releases of all of the build tools (including conda-build) and we have found a bug (or we've configured in some way that wasn't previously supported).

@pelson
Copy link
Member

pelson commented Mar 26, 2016

Maybe we should pin to an old conda-build until this is resolved?

@ocefpaf
Copy link
Member Author

ocefpaf commented Mar 26, 2016

I must be doing something wrong because I tried to downgrade conda-build and that did not work. I also pulled the docker image yesterday! Let me try again here to see what I am doing wrong.

@ocefpaf
Copy link
Member Author

ocefpaf commented Mar 26, 2016

@pelson with the commands

docker pull pelson/obvious-ci:latest_x64
docker run -it --rm -v $(pwd):/home/ pelson/obvious-ci:latest_x64 /bin/sh
conda update --all --yes
conda build home

I cannot reproduce the issue. And here is the conda info output:

             platform : linux-64
        conda version : 4.0.5
  conda-build version : 1.20.0
       python version : 3.5.1.final.0
     requests version : 2.9.1
     root environment : /opt/conda  (writable)
  default environment : /opt/conda
     envs directories : /opt/conda/envs
        package cache : /opt/conda/pkgs
         channel URLs : https://repo.continuum.io/pkgs/free/linux-64/
                        https://repo.continuum.io/pkgs/free/noarch/
                        https://repo.continuum.io/pkgs/pro/linux-64/
                        https://repo.continuum.io/pkgs/pro/noarch/
          config file : /root/.condarc
    is foreign system : False

Also, this packaged built just fine in staged recipes with conda-build 1.19.2 on staged-recipes. However, downgrading conda-build to 1.18.2 solved it! I am very 😖

@ocefpaf ocefpaf merged commit 0ff4fc6 into conda-forge:master Mar 26, 2016
@ocefpaf ocefpaf deleted the sha branch March 26, 2016 13:01
@stuarteberg
Copy link

A bit of background: when checking the git revision of a package, conda-build runs a couple git commands, including git remote -v, to locate the conda-build's cached copy of your git repo:

$ cd /miniconda/conda-bld/work
$ git remote -v
origin  /miniconda/conda-bld/git_cache/Users_bergs_Documents_mypackage (fetch)
origin  /miniconda/conda-bld/git_cache/Users_bergs_Documents_mypackage (push)

It parses the fetch path from that output, and then -- as a sanity check -- it asserts that the path it found contains the string conda-bld/git_cache. But somehow, that sanity check is failing in your case. In your docker container, does the conda-bld/git_cache directory exist? If not, then I need to understand why.

(PS -- The recently-merged conda/conda-build#801 still includes the above-mentioned assertion, so it won't fix the issue you saw here.)

@ocefpaf
Copy link
Member Author

ocefpaf commented Mar 29, 2016

Thanks for the explanation @stuarteberg.

does the conda-bld/git_cache directory exist?

Not sure as that only happens when running the CI. Everything works when I build it locally with the same docker image. @pelson any ideas? Could it be how we mount the volumes?

@pelson
Copy link
Member

pelson commented Mar 30, 2016

git diff | cat
diff --git a/ci_support/run_docker_build.sh b/ci_support/run_docker_build.sh
index 26c5104..e94caf3 100755
--- a/ci_support/run_docker_build.sh
+++ b/ci_support/run_docker_build.sh
@@ -40,7 +40,7 @@ echo "$config" > ~/.condarc
 conda clean --lock

 conda update --yes --all
-conda install --yes conda-build==1.18.2
+conda install --yes conda-build
 conda info
$ > ./ci_support/run_docker_build.sh 
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ......
Solving package specifications: .........

Package plan for installation in environment /opt/conda:

The following packages will be UPDATED:

    conda-build: 1.19.2-py35_0     defaults --> 1.20.0-py35_0 defaults   
    obvious-ci:  0.5.2.dev2-py35_0 pelson   --> 0.6.1-py35_0  conda-forge
    pip:         8.1.1-py35_0      defaults --> 8.1.1-py35_1  defaults   

Fetching packages ...
pip-8.1.1-py35 100% |###############################| Time: 0:00:10 154.30 kB/s
conda-build-1. 100% |###############################| Time: 0:00:01 116.33 kB/s
obvious-ci-0.6 100% |###############################| Time: 0:00:00 114.98 kB/s
Extracting packages ...
[      COMPLETE      ]|##################################################| 100%
Unlinking packages ...
[      COMPLETE      ]|##################################################| 100%
Linking packages ...
[      COMPLETE      ]|##################################################| 100%
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ......
Solving package specifications: .........

# All requested packages already installed.
# packages in environment at /opt/conda:
#
conda-build               1.20.0                   py35_0    defaults
Using Anaconda Cloud api site https://api.anaconda.org
Current conda install:

             platform : linux-64
        conda version : 4.0.5
  conda-build version : 1.20.0
       python version : 3.5.1.final.0
     requests version : 2.9.1
     root environment : /opt/conda  (writable)
  default environment : /opt/conda
     envs directories : /opt/conda/envs
        package cache : /opt/conda/pkgs
         channel URLs : https://conda.anaconda.org/conda-forge/linux-64/
                        https://conda.anaconda.org/conda-forge/noarch/
                        https://repo.continuum.io/pkgs/free/linux-64/
                        https://repo.continuum.io/pkgs/free/noarch/
                        https://repo.continuum.io/pkgs/pro/linux-64/
                        https://repo.continuum.io/pkgs/pro/noarch/
          config file : /root/.condarc
    is foreign system : False

Removing old build environment
Removing old work directory
BUILD START: nn-1.86.0-0
Removing old work directory
checkout: '33cbf70dec4f64836a26dcb4a885cb09b7279dd3'
Initialized empty Git repository in /feedstock_root/build_artefacts/work/.git/
Note: checking out '33cbf70dec4f64836a26dcb4a885cb09b7279dd3'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 33cbf70... v. 1.86.0
==> git log -n1 <==

commit 33cbf70dec4f64836a26dcb4a885cb09b7279dd3
Author: Pavel Sakov <sakov@users.noreply.github.com>
Date:   Mon Mar 14 14:46:34 2016 +1100

    v. 1.86.0


==> git describe --tags --dirty <==

v1.85.0-2-g33cbf70


==> git status <==

# Not currently on any branch.
nothing to commit (working directory clean)


An unexpected error has occurred, please consider sending the
following traceback to the conda GitHub issue tracker at:

    https://github.com/conda/conda-build/issues

Include the output of the command 'conda info' in your report.


Traceback (most recent call last):
  File "/opt/conda/bin/conda-build", line 5, in <module>
    sys.exit(main())
  File "/opt/conda/lib/python3.5/site-packages/conda_build/main_build.py", line 208, in main
    args_func(args, p)
  File "/opt/conda/lib/python3.5/site-packages/conda_build/main_build.py", line 493, in args_func
    args.func(args, p)
  File "/opt/conda/lib/python3.5/site-packages/conda_build/main_build.py", line 438, in execute
    include_recipe=args.include_recipe)
  File "/opt/conda/lib/python3.5/site-packages/conda_build/build.py", line 418, in build
    m.parse_again(permit_undefined_jinja=False)
  File "/opt/conda/lib/python3.5/site-packages/conda_build/metadata.py", line 356, in parse_again
    self.meta = parse(self._get_contents(permit_undefined_jinja))
  File "/opt/conda/lib/python3.5/site-packages/conda_build/metadata.py", line 634, in _get_contents
    env.globals.update(context_processor(self, path))
  File "/opt/conda/lib/python3.5/site-packages/conda_build/jinja_context.py", line 65, in context_processor
    ctx = get_environ(m=initial_metadata)
  File "/opt/conda/lib/python3.5/site-packages/conda_build/environ.py", line 197, in get_dict
    m.get_value('source/git_rev')))
  File "/opt/conda/lib/python3.5/site-packages/conda_build/environ.py", line 79, in get_git_build_info
    assert "conda-bld/git_cache" in cache_dir
AssertionError

@stuarteberg
Copy link

does the conda-bld/git_cache directory exist?

Not sure as that only happens when running the CI.

OK, I didn't know that conda-build's root directory was configurable via .condarc, but I see that your CI setup uses a custom root-dir:

conda-build:
 root-dir: /feedstock_root/build_artefacts

That means the assertion I referred to above isn't actually valid. It will be removed via conda/conda-build#855.

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

Successfully merging this pull request may close these issues.

4 participants