Skip to content

Very simple local coding sandbox example#80

Merged
SumanthRH merged 17 commits intoNovaSky-AI:mainfrom
pcmoritz:simplecoder
Jul 14, 2025
Merged

Very simple local coding sandbox example#80
SumanthRH merged 17 commits intoNovaSky-AI:mainfrom
pcmoritz:simplecoder

Conversation

@pcmoritz
Copy link
Collaborator

@pcmoritz pcmoritz commented Jul 12, 2025

This PR adds a simple sandbox example using the Guix package manager

This change introduces a basic sandbox environment powered by Guix (https://guix.gnu.org/), a package manager that comes with thousands of pre-built software packages that you can easily customize and compile.

How it works

Guix makes it easy to set up development environments with all the right dependencies. For example, if you want to work on a Linux package like Inkscape, you can run guix shell --development inkscape and it automatically gives you a shell with everything needed to build that software.

You can also create custom environments by running guix shell -m manifest.scm, where the manifest.scm file lists exactly which packages and dependencies you want. Think of this like Python's uv run command, but instead of just handling Python projects, it can set up complete Linux development environments for any type of software:

manifest.scm (in Guix) = pyproject.toml (in Python)
guix shell (for any Linux software) = uv run (for Python only)

This gives developers a consistent way to create isolated, reproducible development environments for any kind of project.

How to use it

The docker image / environment you are working in needs to have guix installed, you can
e.g. install it by running

wget https://guix.gnu.org/install.sh
chmod +x install.sh
sudo ./install.sh

For the following commands, we assume that you are in the sky-train/examples/simplecoder directory. It is worth running the following command once to initialize the packages (this ensures the following commands won't time out):

guix shell -m manifest.scm -- sh

To run the example, first clone the test repository

git clone https://github.com/SWE-agent/test-repo

and then you can run the "agent" using

python simplecoder.py

@pcmoritz pcmoritz changed the title Very simple local coding sandbox Very simple local coding sandbox example Jul 12, 2025
@SumanthRH SumanthRH self-assigned this Jul 12, 2025
@SumanthRH SumanthRH self-requested a review July 12, 2025 05:59
Copy link
Member

@SumanthRH SumanthRH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

I'm also able to follow the instructions to get this running easily.

Discussed offline and we'll have the same PR description as a README for running with guix in examples/simplecoder.

In a future PR, we will integrate with skyrl-train so that we have an actual training script to show. This can start off simple with livecodebench and then we can also move to complex tasks.

working_dir = os.path.abspath("test-repo")
executor = simplecoder.GuixExecutor(working_dir, manifest)

coder = simplecoder.SimpleCoder(os.environ["OPENAI_KEY"], "o4-mini", executor)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: might be better to rename to OPENAI_API_KEY, we already use it in other envs like #55

@SumanthRH SumanthRH merged commit 3e0efc0 into NovaSky-AI:main Jul 14, 2025
3 checks passed
fannie1208 pushed a commit to vinid/SkyRL that referenced this pull request Aug 19, 2025
**This PR adds a simple sandbox example using the Guix package manager**

This change introduces a basic sandbox environment powered by Guix
(https://guix.gnu.org/), a package manager that comes with thousands of
pre-built software packages that you can easily customize and compile. 

Note that the integration with SkyRL-Train will land in a future PR.

**How it works**

Guix makes it easy to set up development environments with all the right
dependencies. For example, if you want to work on a Linux package like
Inkscape, you can run `guix shell --development inkscape` and it
automatically gives you a shell with everything needed to build that
software.

You can also create custom environments by running `guix shell -m
manifest.scm`, where the `manifest.scm` file lists exactly which
packages and dependencies you want. Think of this like Python's `uv run`
command, but instead of just handling Python projects, it can set up
complete Linux development environments for any type of software:

`manifest.scm` (in Guix) = `pyproject.toml` (in Python)
`guix shell` (for any Linux software) = `uv run` (for Python only)

This gives developers a consistent way to create isolated, reproducible
development environments for any kind of project.

**How to use it**

The docker image / environment you are working in needs to have guix
installed, you can
e.g. install it by running

```shell
wget https://guix.gnu.org/install.sh
chmod +x install.sh
sudo ./install.sh
```

For the following commands, we assume that you are in the
`sky-train/examples/simplecoder` directory. It is worth running the
following command once to initialize the packages (this ensures the
following commands won't time out):

```shell
guix shell -m manifest.scm -- sh
```

To run the example, first clone the test repository
```shell
git clone https://github.com/SWE-agent/test-repo
```

and then you can run the "agent" using
```shell
python simplecoder.py
```

---------

Co-authored-by: pcmoritz <pcmoritz@anyscale.com>
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.

2 participants