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

Improve dev containers so autogpt can browse the web #1942

Merged
merged 1 commit into from
Apr 16, 2023

Conversation

bennyhobart
Copy link

Background

Currently dev containers do not contain everything necessary to run AutoGPT, and between different environments installing these dependencies can be quite a mess.

This diff aims to give the containers everything necessary to just follow the readme and get going with auto-gpt in dev containers

Changes

  • Update dockerfile to pull from know environment, the expectation is on apple silicon people will use rosetta to run this container, this change allows us to install chrome, sourcery and other standard things without much finangling
  • Install Chrome, necessary to browse
  • add options.add_argument("--no-sandbox") to Chrome startup so it can run in dev containers, this does have bad security implications https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/design/sandbox.md, and we might be able to get around it in another way (changing user starting chrome from root -> userspace, moving from debian(?))

Documentation

All specific things added are self documented, I could add a comment above the chrome install line if we wanted to outline, but seems readable as is

Test Plan

Reload and rebuild dev container

Run autogpt with goals of [Navigate to https://en.wikipedia.org/wiki/John_Wick:_Chapter_4', 'summarize page', 'output to file'] and role of "an AI designed to summarize webpages"

Observe glory

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

Currently no tests exists for dev containers, I only learnt about these today when pulling down autogpt but might be wortwhile investing in

@bennyhobart
Copy link
Author

There's a few related issues for this
#1445
#1788
#1711

@nponeccop nponeccop added the B7 label Apr 16, 2023
@AndresCdo
Copy link
Contributor

This is an important PR, on master currently Auto-GPT can't use web resources.

SYSTEM: Command browse_website returned: Error: Message: unknown error: DevToolsActivePort file doesn't exist Stacktrace: #0 0x55d407b34fe3 <unknown> #1 0x55d407873d36 <unknown> #2 0x55d4078a0459 <unknown> #3 0x55d40789c051 <unknown> #4 0x55d407898a9b <unknown> #5 0x55d4078daaf7 <unknown> #6 0x55d4078da11f <unknown> #7 0x55d4078d1693 <unknown> #8 0x55d4078a403a <unknown> #9 0x55d4078a517e <unknown> #10 0x55d407af6dbd <unknown> #11 0x55d407afac6c <unknown> #12 0x55d407b044b0 <unknown> #13 0x55d407afbd63 <unknown> #14 0x55d407acec35 <unknown> #15 0x55d407b1f138 <unknown> #16 0x55d407b1f2c7 <unknown> #17 0x55d407b2d093 <unknown> #18 0x7f5dc8294b43 <unknown>

@nponeccop
Copy link
Contributor

Did you check the current master? Works fine if you have chrome or firefox. If you have edge, wait for #1988 to get merged

@bennyhobart
Copy link
Author

@nponeccop that diff will not fix default behavior of dev containers; dev containers do not have a browser installed

@nponeccop
Copy link
Contributor

Oh, I was misled by "This is an important PR, on master currently Auto-GPT can't use web resources.

It should have been "This is an important PR, on master currently Auto-GPT can't use web resources when run in containers, as this PR only affects containers".

I see now, sorry for misunderstanding.

@p-i- p-i- merged commit 8f0d553 into Significant-Gravitas:master Apr 16, 2023
@bennyhobart
Copy link
Author

no worries @nponeccop ! I appreciate you revieweing all this code, very busy repo and definitely a huge lift to get through it all

Thanks!

@bennyhobart bennyhobart deleted the devcontainer-fix branch April 17, 2023 00:50
@nponeccop nponeccop mentioned this pull request Apr 17, 2023
1 task
@johnseth97
Copy link
Contributor

johnseth97 commented Apr 22, 2023

This PR breaks things for anyone trying to run on an ARM device, such as AWS EC2 instances or M1 Mac devices.

The docker file needs to be architecture agnostic, not specifying amd64.

@tajkirkpatrick
Copy link

The docker file needs to be architecture agnostic, not specifying amd64.

@desojo do you have any experience running a headless version of a Firefox browser in Linux (using selenium)? In my own fork off this repo trying to Dockerize it for ARM, you'd only need to do one or two more things after changing the default browser to Firefox for this to be ARM ready.

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.

None yet

6 participants