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

Revision output of github action build_spack is not useful #134

Open
BenjaminRodenberg opened this issue Oct 21, 2021 · 6 comments
Open
Labels
bug Something isn't working

Comments

@BenjaminRodenberg
Copy link
Member

See #133 (comment) and #133 (comment).

We currently get the output unknown+0 for the version when running the action build_spack online (see here). However, in different local tests the output is as expected. This makes the action less useful, because we don't see which version is actually tested. From local, manual testing everything looks good, but this is a bit contradicting the idea of having a CI here.

The goal is to have identical output for local runs (e.g. via act -j build_spack) and for the online CI.

@BenjaminRodenberg BenjaminRodenberg added the bug Something isn't working label Oct 21, 2021
@ajaust
Copy link
Collaborator

ajaust commented Oct 21, 2021

Is the clean directive of the action a problem? See the docs of the action https://github.com/actions/checkout

I added the git log -n 5 command and a ls -l command to the action for testing and the directory is not a git repository anymore: https://github.com/ajaust/python-bindings/runs/3966000307?check_suite_focus=true

No .git directory or similar are in the directory anymore.

@BenjaminRodenberg
Copy link
Member Author

Is the clean directive of the action a problem? See the docs of the action https://github.com/actions/checkout

I added the git log -n 5 command and a ls -l command to the action for testing and the directory is not a git repository anymore: https://github.com/ajaust/python-bindings/runs/3966000307?check_suite_focus=true

No .git directory or similar are in the directory anymore.

That's interesting. This means that act and github actions behave differently here:

benjamin@...:$ git checkout a70f7ee611890a11d4c7da0bd20dc1c98ad66caa
Note: switching to 'a70f7ee611890a11d4c7da0bd20dc1c98ad66caa'.

You are in 'detached HEAD' state. ...

benjamin@...:~/Programming/python-bindings$ act -l
ID                                               Stage  Name                                                               
setup_install                                    0      Run setup install                                                  
setup_test                                       0      Run setup test                                                     
build-and-release-docker-image                   0      Builds a dockerimage with the python bindings of preCICE           
build_spack                                      0      build_spack                                                        
autopep8                                         0      autopep8                                                           
deploy                                           0      deploy                                                             
run_solverdummies                                0      Run solverdummies                                                  
pip_install                                      1      Run pip install                                                    
solverdummy_test                                 1      Run solverdummy                                                    
setup_for_spack                                  1      Run setup.py phases needed by spack                                
setup_install_single_version_externally_managed  1      Run setup install --single-version-externally-managed (for spack)  
benjamin@...:~/Programming/python-bindings$ act -j build_spack
...
| warning: cyprecice/cyprecice.pyx:1211:57: local variable '_value' referenced before assignment
| warning: cyprecice/cyprecice.pyx:1212:15: local variable '_value' referenced before assignment
| ==> py-pyprecice: Successfully installed py-pyprecice-develop-zgzaqxe3rimtfztg6tnkshtaytsu6muu
|   Fetch: 0.00s.  Build: 5.69s.  Total: 5.69s.
| [+] /opt/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.5.0/py-pyprecice-develop-zgzaqxe3rimtfztg6tnkshtaytsu6muu
| total 252
| drwxr-xr-x 5 root root  4096 Oct 21 16:16 build
| -rw-rw-r-- 1 1000 1000  2542 Oct 19 10:58 CHANGELOG.md
| -rw-rw-r-- 1 1000 1000  2513 Aug 13 10:29 CHANGELOG.md.orig
| drwxr-xr-x 2 root root  4096 Oct 21 16:16 cyprecice
| drwxr-xr-x 2 root root  4096 Oct 21 16:15 dist
| drwxr-xr-x 2 root root  4096 Oct 21 16:15 docs
| -rw-rw-r-- 1 1000 1000  7652 Jul 20 07:06 LICENSE.txt
| -rw-rw-r-- 1 1000 1000   265 Jul 20 07:06 MANIFEST.in
| drwxr-xr-x 2 root root  4096 Oct 21 16:15 precice
| drwxr-xr-x 2 root root  4096 Oct 21 16:15 __pycache__
| drwxr-xr-x 2 root root  4096 Oct 21 16:16 pyprecice.egg-info
| -rw-rw-r-- 1 1000 1000   159 Jul 20 07:06 pyproject.toml
| -rw-rw-r-- 1 1000 1000 12968 Oct 21 16:14 README.md
| -rw-rw-r-- 1 1000 1000   825 Jul 20 07:06 setup.cfg
| -rw-rw-r-- 1 1000 1000  5817 Oct 21 16:14 setup.py
| drwxr-xr-x 2 root root  4096 Oct 21 16:15 solverdummy
| drwxr-xr-x 3 root root  4096 Oct 21 16:15 spack
| -rw-r--r-- 1 root root  1338 Oct 21 16:15 spack-build-01-build-out.txt
| -rw-r--r-- 1 root root 10840 Oct 21 16:16 spack-build-02-install-out.txt
| -rw-r--r-- 1 root root 23510 Oct 21 16:15 spack-build-env-mods.txt
| -rw------- 1 root root 25637 Oct 21 16:15 spack-build-env.txt
| -rw-r--r-- 1 root root 12178 Oct 21 16:16 spack-build-out.txt
| drwxr-xr-x 2 root root  4096 Oct 21 16:15 test
| drwxr-xr-x 3 root root  4096 Oct 21 16:15 tools
| -rw-rw-r-- 1 1000 1000 70208 Jul 20 07:06 versioneer.py
| drwxr-xr-x 2 root root  4096 Oct 21 16:15 workflow
| commit a70f7ee611890a11d4c7da0bd20dc1c98ad66caa (HEAD, 
| majaust/gitlab-ci-test)
| Author: Alexander Jaust <[email protected]>
| Date:   Thu Oct 21 17:44:44 2021 +0200
| 
|     show all files and directories (also hidden) in current directory
| 
| commit 2c2a82b1eb82fb2bb1c6e9a6bbf1d0a47455fadb
| Author: Alexander Jaust <[email protected]>
| Date:   Thu Oct 21 17:37:51 2021 +0200
| 
|     change action just for testing
| 
| commit dadad118702f56bf760d1cc4da277b3c7900f64d (origin/develo
| p, origin/HEAD, ajaust/develop, develo
| p)
| Author: Alexander Jaust <[email protected]>
| Date:   Thu Oct 21 16:57:41 2021 +0200
| 
|     Update Spack recipe (v2.3.0.1, release documentation, sync packages) (#133)
|     
|     * [update] Bump the package to the current version included in Spack
|     * [doc] Explain the release cycle of spack packages better

@ajaust
Copy link
Collaborator

ajaust commented Oct 21, 2021

I missed some option in my action so hidden files/directories were not shown. I fixed that and I see some hidden files now: https://github.com/ajaust/python-bindings/runs/3966490670?check_suite_focus=true

In fact, the .git is missing. Other hidden files and directories are still there.

==> Installing py-pyprecice-develop-4gcofqcr52tavsjvkdz4fdwteylplwer
==> No binary for py-pyprecice-develop-4gcofqcr52tavsjvkdz4fdwteylplwer found: installing from source
==> No patches needed for py-pyprecice
==> py-pyprecice: Executing phase: 'build'
==> py-pyprecice: Executing phase: 'install'
==> py-pyprecice: Successfully installed py-pyprecice-develop-4gcofqcr52tavsjvkdz4fdwteylplwer
  Fetch: 0.00s.  Build: 8.29s.  Total: 8.29s.
[+] /opt/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.5.0/py-pyprecice-develop-4gcofqcr52tavsjvkdz4fdwteylplwer
total 260K
drwxr-xr-x 13 1001  121 4.0K Oct 21 16:31 .
drwxr-xr-x  3 1001  121 4.0K Oct 21 16:29 ..
drwxr-xr-x  5 root root 4.0K Oct 21 16:31 build
-rw-rw-r--  1 root root 2.5K Oct 21 16:29 CHANGELOG.md
drwxrwxr-x  2 root root 4.0K Oct 21 16:31 cyprecice
drwxrwxr-x  2 root root 4.0K Oct 21 16:29 docs
-rw-rw-r--  1 root root   33 Oct 21 16:29 .gitattributes
drwxrwxr-x  3 root root 4.0K Oct 21 16:29 .github
-rw-rw-r--  1 root root  108 Oct 21 16:29 .gitignore
-rw-rw-r--  1 root root 7.5K Oct 21 16:29 LICENSE.txt
-rw-rw-r--  1 root root  265 Oct 21 16:29 MANIFEST.in
drwxrwxr-x  2 root root 4.0K Oct 21 16:29 precice
drwxr-xr-x  2 root root 4.0K Oct 21 16:31 __pycache__
drwxr-xr-x  2 root root 4.0K Oct 21 16:31 pyprecice.egg-info
-rw-rw-r--  1 root root  159 Oct 21 16:29 pyproject.toml
-rw-rw-r--  1 root root  13K Oct 21 16:29 README.md
-rw-rw-r--  1 root root  825 Oct 21 16:29 setup.cfg
-rw-rw-r--  1 root root 5.7K Oct 21 16:29 setup.py
drwxrwxr-x  2 root root 4.0K Oct 21 16:29 solverdummy
drwxrwxr-x  3 root root 4.0K Oct 21 16:29 spack
-rw-r--r--  1 root root 1.1K Oct 21 16:31 spack-build-01-build-out.txt
-rw-r--r--  1 root root  11K Oct 21 16:31 spack-build-02-install-out.txt
-rw-r--r--  1 root root  23K Oct 21 16:31 spack-build-env-mods.txt
-rw-------  1 root root  26K Oct 21 16:31 spack-build-env.txt
-rw-r--r--  1 root root  12K Oct 21 16:31 spack-build-out.txt
-rwxr-xr-x  1 root root    0 Oct 21 16:31 .spack_no_patches
drwxrwxr-x  2 root root 4.0K Oct 21 16:29 test
drwxrwxr-x  3 root root 4.0K Oct 21 16:29 tools
-rw-rw-r--  1 root root  69K Oct 21 16:29 versioneer.py
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

@ajaust
Copy link
Collaborator

ajaust commented Oct 21, 2021

The checkout stage of the action might give us the answer:

The repository will be downloaded using the GitHub REST API
To create a local Git repository instead, add Git 2.18 or higher to the PATH

There is also an issue actions/checkout#335

@ajaust
Copy link
Collaborator

ajaust commented Oct 21, 2021

By force installing a newer Git version, as suggested in actions/checkout#335, it works.

See: https://github.com/ajaust/python-bindings/runs/3966791087?check_suite_focus=true

However only the git commit hash is visible, but not the version number. Could this be a problem since only the last commit is fetched i.e. the version information is not available.

@ajaust
Copy link
Collaborator

ajaust commented Oct 21, 2021

Fetching all history for all tags and branchesetch-all-history-for-all-tags-and-branches gives me a nonzero version number, but it prints

Installed version of bindings is v2.0.1.1+151.g56f7d14

instead of v2.3.0.1+somthing. The commit hash is still correct though.

https://github.com/ajaust/python-bindings/runs/3967769011?check_suite_focus=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants