-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from camel-ai/update-docs
Update and clean outdated code
- Loading branch information
Showing
27 changed files
with
1,090 additions
and
1,081 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,47 @@ | ||
TODO | ||
## Install CRAB | ||
|
||
First you should install `poetry`, a modern python dependency management tool. | ||
|
||
Then pull the crab repo and install: | ||
|
||
```bash | ||
git clone https://github.com/camel-ai/crab | ||
|
||
cd crab | ||
poetry install -E client | ||
``` | ||
|
||
## Install Ubuntu VM | ||
|
||
**IMPORTANT: If you are using an Ubuntu VM, the Python version in the VM must match the Python version on the host machine. If you follow this instruction to install Ubuntu, the Python version in the VM will be 3.10.12. Consider using `conda` or `pyenv` to install the same Python version on the host machine.** | ||
|
||
Install `virt-manager`. If you are using Ubuntu or Debian, try `sudo apt install virt-manager`. | ||
|
||
Download [Ubuntu 22.04 image](https://releases.ubuntu.com/jammy/ubuntu-22.04.4-desktop-amd64.iso), then create a new machine with at least 8G RAM and 30G disk in virt-manager using the image. Follow the instruction and complete the installation. (It's better to use `crab` as the main user name.) | ||
|
||
After install Ubuntu, you should install crab-server on it and do necessary initilization. In Ubuntu VM, run | ||
|
||
```bash | ||
git clone https://github.com/camel-ai/crab.git ~/crab/ | ||
cd ~/crab/crab-benchmark-v0/scripts | ||
chmod +x ubuntu_env_init.sh | ||
./ubuntu_env_init.sh | ||
``` | ||
|
||
The VM will reboot after initilization. After rebooting, remember its ip address. | ||
|
||
## Install Android Emulator | ||
|
||
Download the newest version of [Android Studio](https://developer.android.com/studio). Install it. | ||
|
||
Open Android studio and use build-in device manager to create a Pixel 8 Pro with system image release "R". | ||
|
||
![](./assets/android_1.png) | ||
|
||
![](./assets/android_2.png) | ||
|
||
Then boot it. | ||
|
||
## Install ADB | ||
|
||
Download and install ADB from its [official website](https://developer.android.com/tools/releases/platform-tools) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/bin/bash | ||
|
||
# Disable screen autolock | ||
gsettings set org.gnome.desktop.screensaver lock-enabled false | ||
gsettings set org.gnome.desktop.session idle-delay 0 | ||
|
||
# Disable automatic updates | ||
sudo bash -c 'cat <<EOF > /etc/apt/apt.conf.d/20auto-upgrades | ||
APT::Periodic::Update-Package-Lists "0"; | ||
APT::Periodic::Unattended-Upgrade "0"; | ||
EOF' | ||
|
||
# Allow sudo without password for the current user | ||
CURRENT_USER=$(whoami) | ||
sudo bash -c "echo \"$CURRENT_USER ALL=(ALL) NOPASSWD: ALL\" | tee /etc/sudoers.d/$CURRENT_USER" | ||
|
||
# Install required packages | ||
sudo apt update | ||
sudo apt install -y openssh-server git vim python3-pip xdotool python3-tk python3.10-venv | ||
|
||
# Install pipx | ||
python3 -m pip install pipx | ||
python3 -m pipx ensurepath | ||
|
||
# Modify .bashrc to alias python to python3 for the current user | ||
echo 'alias python=python3' >> /home/$CURRENT_USER/.bashrc | ||
|
||
# Reload .bashrc for the current user | ||
source /home/$CURRENT_USER/.bashrc | ||
|
||
# Install poetry using pipx | ||
pipx install poetry | ||
|
||
# Pull CRAB repo | ||
if [ ! -d "/home/$CURRENT_USER/crab" ]; then | ||
git clone https://github.com/camel-ai/crab.git /home/$CURRENT_USER/crab/ | ||
fi | ||
|
||
# Create poetry environment | ||
cd /home/$CURRENT_USER/crab | ||
poetry install -E server | ||
|
||
# Change to X11 from Wayland | ||
sudo sed -i 's/#WaylandEnable=false/WaylandEnable=false/g' /etc/gdm3/custom.conf | ||
touch /home/$CURRENT_USER/.Xauthority | ||
|
||
# Create the crab.service file with dynamic user and group | ||
sudo bash -c "cat <<EOF > /etc/systemd/system/crab.service | ||
[Unit] | ||
Description=My Python Script Service | ||
After=network.target | ||
[Service] | ||
WorkingDirectory=/home/$CURRENT_USER/crab/ | ||
ExecStart=/home/$CURRENT_USER/.local/bin/poetry run python -m crab.server.main --HOST 0.0.0.0 | ||
Restart=always | ||
User=$CURRENT_USER | ||
Group=$CURRENT_USER | ||
[Install] | ||
WantedBy=multi-user.target | ||
EOF" | ||
|
||
# Reload systemd to recognize the new service | ||
sudo systemctl daemon-reload | ||
|
||
# Enable and start the crab service | ||
sudo systemctl enable crab.service | ||
|
||
# Reboot the system to apply changes for X11 | ||
echo "System will reboot in 10 seconds to apply changes..." | ||
sleep 10 | ||
sudo reboot |
Oops, something went wrong.