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

Add Nix flakes support through direnv #1091

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

superherointj
Copy link
Contributor

@superherointj superherointj commented Apr 13, 2023

Add Nix flakes support through direnv

Background

  • Nix (https://nixos.org) is a reproducible build system. Having Nix support enables Nix users to develop and use Auto-GPT without having to deal with inner dependencies (such as PIP or any other future Auto-GPT dependency).

  • To avoid Nix pollution to Auto-GPT repository, I have made Nix files a discrete repository:

  • Note: This only affects nix / direnv users and direnv explicitly requests permission from user to enable this.

.envrc file is used by direnv (https://github.com/nix-community/nix-direnv)
When direnv is installed and configured, this script runs when openning directory.
It first checks for nix shell, then direnv explicitly request user permission once to load dependencies.
Onwards direnv will automatically load dependencies on entering directory.
Eliminating the need of "nix develop github:superherointj/nix-auto-gpt" for Nix users.

Changes

Documentation

Test Plan

To test:

  • Have Nix (with Flakes) and direnv installed.
  • Open Auto-GPT repo directory.
  • direnv will request permission.
  • Then, all project dependencies are loaded automatically.

PR Quality Checklist

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes

@superherointj superherointj force-pushed the nix-flake-init branch 2 times, most recently from f015880 to 82ff10c Compare April 13, 2023 11:27
nponeccop
nponeccop previously approved these changes Apr 13, 2023
@superherointj superherointj marked this pull request as draft April 13, 2023 12:04
@superherointj superherointj changed the title Add Nix flakes support [wip] Add Nix flakes support Apr 13, 2023
@superherointj superherointj changed the title [wip] Add Nix flakes support [wip] Add Nix flakes support through direnv Apr 13, 2023
@superherointj superherointj force-pushed the nix-flake-init branch 2 times, most recently from 3914b59 to dddba79 Compare April 13, 2023 13:45
@superherointj superherointj changed the title [wip] Add Nix flakes support through direnv Add Nix flakes support through direnv Apr 13, 2023
@superherointj superherointj marked this pull request as ready for review April 13, 2023 14:01
@superherointj superherointj requested a review from nponeccop April 13, 2023 14:01
nponeccop
nponeccop previously approved these changes Apr 13, 2023
@nponeccop nponeccop mentioned this pull request Apr 13, 2023
1 task
@richbeales richbeales added the needs discussion To be discussed among maintainers label Apr 14, 2023
nponeccop
nponeccop previously approved these changes Apr 14, 2023
* Nix (https://nixos.org) is a reproducible build system.
* Enables Nix users to use/develop Auto-GPT, without installing PIP or any other future Auto-GPT dependency.
@p-i- p-i- merged commit d47466d into Significant-Gravitas:master Apr 17, 2023
@dhensen
Copy link
Contributor

dhensen commented Apr 17, 2023

I missed this PR, so I'm late to the party, but I feel like merging this feels a little pre-mature. Let me explain why.

First, I don't want to attribute bad motive to @superherointj, the discrete repository looks good quality and as a user you look trustworthy.

But what happens when this repository suddenly contains malicious code/script? Maybe at least pin the commit that is being used, so that you can consciously screen the versioned code first before upgrading to latest.

What do you think @p-i- @richbeales @nponeccop ?

@superherointj
Copy link
Contributor Author

But what happens when this repository suddenly contains malicious code/script?

If repo had malicious code it wouldn't be executed by default. Unless user granted permission through direnv.
This would only affect the subgroup of Nix users that have enabled direnv and explicitly allowed to fetch dependencies.

Maybe at least pin the commit that is being used, so that you can consciously screen the versioned code first before upgrading to latest.

Then, for every change of package (and there may be many as things are going), it would also mean making a PR to Auto-GPT to bump hashes. I don't know if that is a good flow. Specially at current rate things are changing.

I wouldn't mind if the repository was under Auto-GPT ownership and some review process would take place. But then,
if reviews are mandatory it would require having several Nix maintainers to approve each other PRs. I think it's a bit early to change this. But once there is a thriving community around the repo, it makes sense.

@superherointj
Copy link
Contributor Author

superherointj commented Apr 17, 2023

Let me know if you want repository ownership to be transferred to Significant-Gravitas.
I'd prefer to keep commit rights until there are enough Nix maintainers to review each other PRs.

@superherointj superherointj deleted the nix-flake-init branch April 17, 2023 16:48
SquareandCompass pushed a commit to SquareandCompass/Auto-GPT that referenced this pull request Oct 21, 2023
* update funccall

* code format

* update to comments

* update notebook

* remove test for py3.7

* allow funccall to class functions

* add test and clean up notebook

* revise notebook and test

* update

* update mathagent

* Update flaml/autogen/agent/agent.py

Co-authored-by: Chi Wang <[email protected]>

* Update flaml/autogen/agent/user_proxy_agent.py

Co-authored-by: Chi Wang <[email protected]>

* revise to comments

* revise function call design, notebook and test. add doc

* code format

* ad message_to_dict function

* update mathproxyagent

* revise docstr

* update

* Update flaml/autogen/agent/math_user_proxy_agent.py

Co-authored-by: Chi Wang <[email protected]>

* Update flaml/autogen/agent/math_user_proxy_agent.py

Co-authored-by: Qingyun Wu <[email protected]>

* Update flaml/autogen/agent/user_proxy_agent.py

Co-authored-by: Qingyun Wu <[email protected]>

* simply funccall in userproxyagent, rewind auto-gen.md, revise to comments

* code format

* update

* remove notebook for another pr

* revise oai_conversation part  in agent, revise function exec in user_proxy_agent

* update test_funccall

* update

* update

* fix pydantic version

* Update test/autogen/test_agent.py

Co-authored-by: Chi Wang <[email protected]>

* fix bug

* fix bug

* update

* update is_termination_msg to accept dict

---------

Co-authored-by: Chi Wang <[email protected]>
Co-authored-by: Qingyun Wu <[email protected]>
Co-authored-by: Li Jiang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs discussion To be discussed among maintainers Obsolete?
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants