Git Product home page Git Product logo

actions's Introduction

Pants Github Actions

This repository houses actions used by the pantsbuild projects. Other use is not discouraged, but it's also not actively supported at this time.

When adding a new action, just claim a meaningful top-level directory name to house it and then consume it as described here.

No tagging protocol is established yet; so it's probably wise to depend on a specific sha.

actions's People

Contributors

benjyw avatar bryanwweber avatar cognifloyd avatar danxmoran avatar huonw avatar idanyaffe avatar jsirois avatar martimlobao avatar yaminyam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

actions's Issues

breaking change

Thanks for writing this action! Would it make sense to createa an @v1 that can be used given the latest commit is a breaking change?

`Install failed: EOF when reading a line` in blank GitHub Action

See https://github.com/pantsbuild/pantsbuild.org/actions/runs/7343898030/job/19995046003

Run PANTS_BOOTSTRAP_CACHE_KEY=$(PANTS_BOOTSTRAP_TOOLS=2 pants bootstrap-cache-key)
  PANTS_BOOTSTRAP_CACHE_KEY=$(PANTS_BOOTSTRAP_TOOLS=2 pants bootstrap-cache-key)
  if [[ "$OSTYPE" == "darwin"* ]]; then
    PANTS_BOOTSTRAP_CACHE_DIR="$HOME/Library/Caches/nce"
  else
    PANTS_BOOTSTRAP_CACHE_DIR="$HOME/.cache/nce"
  fi
  echo "pants_bootstrap_cache_key=$PANTS_BOOTSTRAP_CACHE_KEY" >> $GITHUB_OUTPUT
  echo "pants_bootstrap_cache_dir=$PANTS_BOOTSTRAP_CACHE_DIR" >> $GITHUB_OUTPUT
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
No Pants configuration was found at or above /home/runner/work/pantsbuild.org/pantsbuild.org.
Install failed: EOF when reading a line
...

I suspect $(PANTS_BOOTSTRAP_TOOLS=2 pants bootstrap-cache-key) doesn't like a missing pants.toml and not being interactive.

intermittent failure: No matching distribution found for setuptools<58

Today I had a failure of the init-pants action (version @main) in our CI. I retried shortly after and it succeeded. I wonder what would cause this to fail intermittently? The error occurred at the pants --version call when bootstrapping pants:

Run pants --version
  pants --version
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.11.3/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.3/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.3/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.3/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.3/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.3/x64/lib
    PANTS_CONFIG_FILES: pants.ci.toml
Bootstrapping Pants 2.15.0 using cpython 3.9.15
Installing pantsbuild.pants==2.15.0 into a virtual environment at /home/runner/.cache/nce/e947b027d236a97e80c898f86405dec4785e8b482758e80af7ef24129029f799/bindings/venvs/2.15.0
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 59.7 MB/s eta 0:00:00
ERROR: Could not find a version that satisfies the requirement setuptools<58 (from versions: 63.4.3)
ERROR: No matching distribution found for setuptools<58
Install failed: Command '['/home/runner/.cache/nce/e947b027d236a97e80c898f86405dec4785e8b482758e80af7ef24129029f799/bindings/venvs/2.15.0/bin/python', '-sE', '-m', 'pip', '--disable-pip-version-check', '--no-python-version-warning', '--log', PosixPath('/home/runner/.cache/nce/e947b027d236a97e80c898f86405dec4785e8b482758e80af7ef24129029f799/bindings/venvs/2.15.0/pants-install.log'), 'install', '--quiet', '--find-links', 'file:///home/runner/.cache/nce/e947b027d236a97e80c898f86405dec4785e8b482758e80af7ef24129029f799/bindings/find_links/2.15.0/214abc14/index.html', '-U', 'pip==22.3.1', 'setuptools<58', 'wheel']' returned non-zero exit status 1.
More information can be found in the log at: /home/runner/.cache/nce/e947b027d236a97e80c898f86405dec4785e8b482758e80af7ef24129029f799/bindings/logs/install.log

Error: Isolates your Pants from the elements.

Please select from the following boot commands:

<default>: Detects the current Pants installation and launches it.
bootstrap-tools: Introspection tools for the Pants bootstrap process.
pants: Runs a hermetic Pants installation.
pants-debug: Runs a hermetic Pants installation with a debug server for debugging Pants code.
update: Update scie-pants.

You can select a boot command by passing it as the 1st argument or else by setting the SCIE_BOOT environment variable.

ERROR: Failed to establish atomic directory /home/runner/.cache/nce/e947b027d236a97e80c898f86405dec4785e8b482758e80af7ef24129029f799/locks/install-e377c19e560680b66eebbb7b25f2c8cf37985e132ee56b579371b97f64bd8b4b. Population of work directory failed: Boot binding command failed: exit status: 1
Error: Process completed with exit code 1.

init-pants should not require a pants.ci.toml

Currently that is its default value for the pants-ci-config key, and it fails if that file doesn't exist.

We should probably allow that file to not to exist? At least if it wasn't explicitly set (do actions allow us to detect whether it was set explicitly?)

`init-pants` intermittent FATAL: exception not rethrown Aborted (core dumped)

Hi, first thank you for the helpful actions!

I am trying to use init-pants@main and sometimes it works successfully and other times I get the following output from pants --version:

Run pants --version
Bootstrapping Pants 2.14.1 using cpython 3.9.15
Installing pantsbuild.pants==2.14.1 into a virtual environment at /home/runner/.cache/nce/6621291ed4120fa45607b367abf7786ce496f389f27240712a63c31f1c438c21/bindings/venvs/2.14.1
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 41.7 MB/s eta 0:00:00
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 819.3/819.3 KB 108.8 MB/s eta 0:00:00
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 64.5/64.5 KB 22.0 MB/s eta 0:00:00
New virtual environment successfully created at /home/runner/.cache/nce/6621291ed4120fa45607b367abf7786ce496f389f27240712a63c31f1c438c21/bindings/venvs/2.14.1.
20:17:51.72 [INFO] Initializing scheduler...
20:17:51.93 [INFO] Scheduler initialized.
2.14.1
FATAL: exception not rethrown
/home/runner/work/_temp/ec994eaa-ce00-453c-936d-273c1589d131.sh: line 1:  1906 Aborted                 (core dumped) pants --version
Error: Process completed with exit code 134.

Considering it is intermittent, the vague nature of the error, the 134 error code, and that it still prints the version, my best guess would be that it is close to a system resource limit. I am not running anything else at the same time.

Is there any way to limit the memory usage? Why would this be exhausting the 7GB actions runner limit?

Let me know if you need additional information. Curious if anyone else is seeing this.

lmdb cache is never hit due to incorrect restore key

In the init-pants action the lmdb cache key can never be hit due to a typo in the key/restore keys.

The cache key (

key: pants-lmdb-store-${{ runner.os }}-pants-${{ inputs.gha-cache-key }}-${{ github.sha }}
) is:

  • pants-lmdb-store-${{ runner.os }}-pants-${{ inputs.gha-cache-key }}-${{ github.sha }}

whilst the restore keys are:

  • pants-lmdb-store-${{ runner.os }}-${{ inputs.gha-cache-key }}-${{ steps.pants-cache-commit.outputs.CACHECOMMIT }}
  • pants-lmdb-store-${{ runner.os }}-${{ inputs.gha-cache-key }}-

As you can see the key has an extra pants in the middle of the key that the restore keys do not. I suggest removing this from the cache key so that the lmdb cache can be hit.

`init-pants` action does not respect `pants_bin_name` option

I'm using the pants_bin_name option to point Pants to ./pants-bin. I've created my own pants script, which does two things:

  • Refreshes a token to access our private CodeArtifact Python package index.
  • Calls pants-bin, passing in all arguments that were provided to the pants script.

This allows us to keep CodeArtifact authenticated and use Pants in the standard way.

Right now I don't think the init-pants GitHub Action respects pants_bin_name option, and instead looks directly in ./pants, which prevents us from using the latest version of this GitHub Action. (I might be wrong here, I'm pretty new to Pants)

Does it make sense to change the behaviour of this GitHub Action to check what pants_bin_name is (or perhaps the version of Pants), instead of having a look inside the pants script itself? If there is a recommended approach, I'm quite happy to attempt this change myself!

init-pants action needs use exact Python version/path in setup cache key

Hi!

The init-pants action is nifty, however I think it may not work when GitHub changes the version of Python (or other aspects of file layout) chosen by a specifier such as 3.9. In particular:

  • setup-python puts everything for a given version into a path like /opt/hostedtoolcache/Python/3.9.13/x64/... (note the minor version number 3.9.13)
  • it seems the Pants setup cache contains symlinks to the relevant system Python executable (e.g /home/runner/.cache/pants/setup/bootstrap-Linux-x86_64/2.13.0_py39/bin/python is a symlink into the directory above)
  • it seems GitHub is happy to update the minor version silently (and even inconsistently)

We're having pants fail to bootstrap in ~30% of runs because currently the setup-python action with python-version: '3.9' usually chooses 3.9.13, but sometimes chooses 3.9.14. Our cache key is fairly similar to the one used by init-pants, and meant we were reusing the 3.9.13 cache (with its 3.9.13-specific symlinks) on the 3.9.14 runner.

The error message (below) is very hard to interpret, because the path listed does exist, but is a symlink to /opt/hostedtoolcache/Python/3.9.13/x64/bin/python, which doesn't exist:

./pants: line 400: /home/runner/.cache/pants/setup/bootstrap-Linux-x86_64/2.13.0_py39/bin/python: No such file or directory

`init-pants` action fails in curl command after #21

PR #21 introduced using ${{ runner.temp }} instead of temp directory /tmp to download get-pants script.
The curl command fails with error curl: (23) Failure writing output to destination since the default worker temp directory /home/runner/work/_temp does not exist.
The fix would be to use flag https://curl.se/docs/manpage.html#--create-dirs which will create the directory if it does not exists.
The final command would look like this
curl --create-dirs --proto '=https' --tlsv1.2 -fsSLo ${{ runner.temp }}/get-pants.sh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.