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

Can cirrus-cli be run locally to preserve an artifact built in a tart image (without using cirrus cloud CI)? #526

Closed
alexey-tereshenkov-oxb opened this issue Jun 9, 2022 · 4 comments · Fixed by #532
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@alexey-tereshenkov-oxb
Copy link

The cirrus-cli tool looks amazing, this is going to be hugely useful. I have a tart image available locally and this configuration file:

task:
  name: Build Python wheel
  macos_instance:
    image: monterey-base-ci
  build_script:
    - python3 -m venv .venv
    - source .venv/bin/activate
    - python3 -m pip install pip wheel setuptools
    - cd toml
    - python3 setup.py bdist_wheel
  binaries_artifacts:
    path: toml/dist/*.whl

After completing running cirrus run -o simple, it says:

'build' script succeeded in 3.3s!
Started 'binaries' artifacts
Uploading 1 artifacts for /tmp/cirrus-ci/working-dir/toml/dist/*.whl
Uploaded /tmp/cirrus-ci/working-dir/toml/dist/toml-0.10.2-py2.py3-none-any.whl
'binaries' artifacts succeeded in 0.0s!
'Build Python wheel' Task succeeded in 13s!

I am struggling to find out where the binary file go? I.e. how do I get it on the machine where I ran the cirrus run command. The docs are focused on CI use case. Is this at all supported to be run locally?

@fkorotkov
Copy link
Contributor

As far as I remember the CLI locally ignored artifact instructions (@edigaryev correct me if I'm wrong). CLI locally inly supports caches (it stores them locally) and annotations (can print out annotation in GHA format #500, for example).

Ideally once we have folder sharing for Tart cirruslabs/tart#13 once Ventura is out we'll be able to support --dirty flag for Tart VMs so FS changes in a VM will be reflected back.

Alternatively, we can support an argument like cirrus run --artifacts-output=$PWD/out so the all the artifacts will be stored in the folder prefixed by <Task name>/<artifacts instruction name>/<artifact path>. 🤔 @edigaryev what do you think?

@fkorotkov fkorotkov added enhancement New feature or request question Further information is requested labels Jun 10, 2022
@alexey-tereshenkov-oxb
Copy link
Author

Thanks @fkorotkov! This makes sense. Being able to produce an artifact in a Tart image and then get it out of it to the host would be amazing. My use case is very similar to what one would use Docker for -- mount a directory, run a container, build something and write into the mounted directory, exit the container. Now you have an artifact created.

If waiting for Ventura and then adding the support for it via the mounting operations would be most reasonable from the design perspective, I'm happy to wait. Otherwise, unless there's a lot of work, having some other mechanism to get the artifacts out (e.g. with something like --artifacts-output) of the Tart VM into the host would be amazing.

@fkorotkov
Copy link
Contributor

We'll definitely will support the --dirty mode on Ventura. But I'll let @edigaryev decide on complexity and viability of adding the --artifacts-output argument.

IMO a separate option might be useful for use cases where you have several tasks producing artifacts with the same path (for example, for different version of macOS or some package). With dirty mode such tasks will override each other artifacts but having --artifacts-output will solve the issue.

@alexey-tereshenkov-oxb
Copy link
Author

alexey-tereshenkov-oxb commented Jun 28, 2022

@fkorotkov @edigaryev thank you so much for adding the --artifacts-dir option, just tested and it does the magic! This is going to help me a lot. Feel free to mention me on issues/PRs if you'd ever want someone to do some exploratory testing, happy to help. I'll keep an eye on new features added, but I think being able to extract the artifacts out of the Tart image will take me very far!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants