build providers: provide support to shell in
Metadata
Current evaluation
Merged PR #2249 (commit 9f5640b17) adding a shell() method to snapcraft build providers, enabling interactive 'shell into' the Multipass/LXD build instance.
Resolution: closed resolved
Reason: The PR was approved and merged by maintainer sergiusens as commit 9f5640b17 ("build providers: provide support to shell in (#2249)"), adding provider shell support referenced by LP bug #1782775; follow-ups #2252 and #2253 built on it.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Add support to shell into the provider,
$ $SNAP/usr/bin/python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from snapcraft.cli import echo
>>> from snapcraft.project import Project
>>> from snapcraft.internal.build_providers import get_provider_for
>>> p = Project(snapcraft_yaml_file_path="snapcraft.yaml")
>>> mp = get_provider_for("multipass")
>>> instance = mp(project=p, echoer=echo)
>>> instance.create()
snapcraft 2.42.1+git81.gca11846.dirty installed
>>> instance.shell()
Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-134-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud
0 packages can be updated.
0 updates are security updates.
New release '18.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
Last login: Fri Sep 7 17:01:08 2018 from 10.72.100.1
snapcraft-make-hello # ls
parts prime project snap stage state
snapcraft-make-hello # logout
>>> instance.destroy()
>>>
LP: #1782775
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)?
- [x] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)?
- [x] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #2249 (commit 9f5640b17) adding a shell() method to snapcraft build providers, enabling interactive 'shell into' the Multipass/LXD build instance. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #2249 in commit 9f5640b17, adding shell access to build providers and resolving LP #1782775. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged. Adds shell access support to build providers, resolving LP #1782775. Approved by reviewer, passed CI checks, and implemented across 8 files. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Introduces instance.shell() to build providers for interactive environment access, resolving LP: #1782775. Code passed unit tests, static checks, and achieved 92.85% diff coverage. |
Update history
No update history recorded yet.
Related work
-
Related To:
snapcraft#2252
(confidence 85%)
Follow-up commit 3410ec32d 'build providers: shell in provider if debug is used' extends the shell support added here.
-
Related To:
snapcraft#2253
(confidence 80%)
Follow-up commit 21cfd4750 'build-providers: add support for --shell-after' builds on the provider shell support merged in this PR.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2254 build providers: add support for --shell | snapcraft | merged | Merged PR #2254 added --shell support for build providers in commit a24d398e4; companion --shell-after support landed in #2253. | |
| #1782775 Add shell API | snapcraft (launchpad) | closed | Implemented by snapcore/snapcraft PR #2249, merged as commit 9f5640b17, adding shell support for the base build environment. | |
| #3660 providers: integrate craft-providers support | snapcraft | merged | PR #3660 by cmatsuoka integrated craft-providers into Snapcraft, running lifecycle commands in LXD/Multipass instances. Merged into the 7.0 line via merge commit 7c2ac0027 (squash commit 8a06cdbbd). | |
| #2509 build providers: initial support for LXD | snapcraft | merged | Merged PR #2509 (commit 067024732) adding initial LXD build-provider support: `snapcraft --use-lxd` runs all lifecycle steps and clean inside an LXD container. Released via beta/lxd channel; LP bug #1805221 closed. | |
| #2252 build providers: shell in provider if debug is used | snapcraft | merged | Merged PR #2252 (commit 3410ec32d) added a shell inside build providers for debug runs, with related test updates. | |
| #1782768 Add --shell for lifecycle steps | snapcraft (launchpad) | closed | Feature request closed by the author's own pointer to snapcraft PR #2254, which added --shell support to build providers (commit a24d398e4); companion --shell-after landed in PR #2253. | |
| #2621 build providers: support injection for LXD | snapcraft | merged | Merged as d59622a81, adding LXD snap injection through snapd's file API, replacing mount-based injection with file pushes, and refactoring provider concerns. | |
| #1779137 build provider support to inject snaps on the host | snapcraft (launchpad) | closed | Build providers gained host-snap injection when Snapcraft runs from a snap; fixed by merged snapcore/snapcraft#2174 (commit 283ab0bb8). | |
| #2869 build providers: use multipass from stable | snapcraft | merged | Merged in canonical/snapcraft#2869 (commit eb9bd8fbf), switching build providers to install Multipass 1.0 from the stable channel. | |
| #2293 build providers: use the new snapcraft: remote for multipass | snapcraft | merged | Merged PR #2293 as commit 66060e839, switching Multipass builds to the snapcraft: remote and delegating unsupported-base errors to Multipass. |