Initial public release of Warp.
Repo-Sync-Origin: warpdotdev/warp-internal@12af1d983b
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
FROM ubuntu:latest
|
||||
|
||||
ENV RUSTUP_HOME=/usr/local/rustup
|
||||
ENV CARGO_HOME=/usr/local/cargo
|
||||
ENV PATH=/usr/local/cargo/bin:/usr/local/go/bin:$PATH
|
||||
|
||||
# This set of packages is adapted from ./script/bootstrap in warp-internal and warp-server.
|
||||
# It doesn't include *everything* (ex. no wgslfmt or gcloud), but is enough to build and test Warp.
|
||||
# Note: currently, only x86_64 builds are supported.
|
||||
|
||||
# Install system-level packages. These are needed to build on Linux, and/or to run integration tests.
|
||||
RUN set -eux; \
|
||||
apt-get update; \
|
||||
apt-get install -y --no-install-recommends \
|
||||
pkg-config git build-essential curl zsh fish vim locales sudo gnupg2 \
|
||||
protobuf-compiler libprotobuf-dev \
|
||||
fontconfig zlib1g libasound2-dev \
|
||||
libx11-6 libxcb1 libxi6 libxcursor1 libxkbcommon-x11-0 \
|
||||
libwayland-client0 libwayland-egl1 \
|
||||
mesa-vulkan-drivers libegl1 \
|
||||
libsqlite3-dev libpq-dev libmysqlclient-dev \
|
||||
ca-certificates \
|
||||
xvfb
|
||||
|
||||
# Install rustup. It will download the pinned version in our rust-toolchain.toml as needed.
|
||||
RUN set -eux; \
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile minimal; \
|
||||
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
|
||||
rustup --version; \
|
||||
cargo --version; \
|
||||
rustc --version
|
||||
|
||||
# Install go and go command-line tools we use.
|
||||
RUN set -eux; \
|
||||
dpkgArch="$(dpkg --print-architecture)"; ARCH="${dpkgArch##*-}"; \
|
||||
curl --proto '=https' --tlsv1.2 -fsSLO https://go.dev/dl/go1.26.1.linux-$ARCH.tar.gz; \
|
||||
tar -C /usr/local -xzf go1.26.1.linux-$ARCH.tar.gz; \
|
||||
go version; \
|
||||
go env -w "GOPRIVATE=github.com/warpdotdev/*"; \
|
||||
CGO_ENABLED=0 go install -tags='no_clickhouse no_libsql no_mssql no_mysql no_sqlite3 no_vertica no_ydb' github.com/pressly/goose/v3/cmd/goose@v3.24.1; \
|
||||
echo "Installed goose"; \
|
||||
go install github.com/vektra/mockery/v2@v2.53.5; \
|
||||
echo "Installed mockery"; \
|
||||
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.6; \
|
||||
echo "Installed protoc-gen-go"; \
|
||||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0; \
|
||||
echo "Installed protoc-gen-go-grpc"; \
|
||||
rm go1.26.1.linux-$ARCH.tar.gz
|
||||
|
||||
# Install golangci-lint
|
||||
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b /usr/local/go/bin v2.6.1 \
|
||||
&& golangci-lint --version
|
||||
|
||||
# Install Node
|
||||
# Adapted from https://github.com/nodejs/docker-node/blob/eda40f3c41d33cb595232cb7000ab31af1ce2f02/25/bookworm/Dockerfile#L8-L17
|
||||
RUN set -eux; \
|
||||
ARCH= ; dpkgArch="$(dpkg --print-architecture)"; \
|
||||
case "${dpkgArch##*-}" in \
|
||||
amd64) ARCH='x64';; \
|
||||
arm64) ARCH='arm64';; \
|
||||
esac; \
|
||||
curl --proto '=https' --tlsv1.2 -fsSLO --compressed "https://nodejs.org/dist/v25.0.0/node-v25.0.0-linux-$ARCH.tar.xz"; \
|
||||
tar -xJf node-v25.0.0-linux-$ARCH.tar.xz -C /usr/local --strip-components=1 --no-same-owner; \
|
||||
rm node-v25.0.0-linux-$ARCH.tar.xz; \
|
||||
ln -s /usr/local/bin/node /usr/local/bin/nodejs; \
|
||||
node --version; \
|
||||
npm --version; \
|
||||
npm install -g corepack; \
|
||||
corepack enable
|
||||
|
||||
# Ensure the correct Rust toolchain is installed
|
||||
COPY ./rust-toolchain.toml ./setup/rust-toolchain.toml
|
||||
RUN cd ./setup && rustup toolchain install
|
||||
|
||||
# Install all dependencies needed to build, run, and test Warp
|
||||
COPY ./script ./setup/script
|
||||
RUN cd ./setup && ./script/linux/install_test_deps
|
||||
|
||||
# Coding Agent CLIs (optional, makes image significantly larger)
|
||||
ARG INSTALL_CODING_AGENTS=false
|
||||
RUN if [ "$INSTALL_CODING_AGENTS" = "true" ]; then \
|
||||
npm install -g \
|
||||
@anthropic-ai/claude-code \
|
||||
@openai/codex \
|
||||
@google/gemini-cli && \
|
||||
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
|
||||
| dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg 2>/dev/null && \
|
||||
chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && \
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
|
||||
> /etc/apt/sources.list.d/github-cli.list && \
|
||||
apt-get update && apt-get install -y --no-install-recommends gh && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
echo "Installed coding agent CLIs:" && \
|
||||
claude --version && \
|
||||
codex --version && \
|
||||
gemini --version && \
|
||||
gh --version && \
|
||||
echo "All CLIs verified" ; \
|
||||
fi
|
||||
@@ -0,0 +1,80 @@
|
||||
FROM debian:sid
|
||||
|
||||
# Install utilities and libraries needed for development.
|
||||
RUN apt-get update \
|
||||
&& apt-get install \
|
||||
sudo \
|
||||
openssh-server \
|
||||
locales \
|
||||
zsh \
|
||||
curl \
|
||||
# Install some editors - nano is nice for simple edits; vim is
|
||||
# needed for some of our tests.
|
||||
nano vim \
|
||||
# Install various core packages for development work on Linux.
|
||||
build-essential cmake pkg-config \
|
||||
# Make it so that running `python` runs `python3`.
|
||||
python-is-python3 \
|
||||
# Development headers for various libraries, needed when compiling
|
||||
# certain Rust crate dependencies.
|
||||
libssl-dev libfreetype-dev libexpat1-dev \
|
||||
# Runtime libraries for X11.
|
||||
xserver-xorg libxcursor1 \
|
||||
# Open-source Vulkan drivers and OpenGL-related utilities from the
|
||||
# mesa project.
|
||||
mesa-vulkan-drivers mesa-utils \
|
||||
# protoc, in order to compile warp-proto-apis crates like the MAA API.
|
||||
protobuf-compiler \
|
||||
# Don't ask for confirmation.
|
||||
-y
|
||||
|
||||
# Install the GitHub CLI.
|
||||
RUN mkdir -p -m 755 /etc/apt/keyrings \
|
||||
&& curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg > /etc/apt/keyrings/githubcli-archive-keyring.gpg \
|
||||
&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
|
||||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
|
||||
&& apt-get update -y \
|
||||
&& apt-get install gh -y
|
||||
|
||||
# Install the gcloud CLI.
|
||||
RUN mkdir -p -m 755 /etc/apt/keyrings \
|
||||
&& curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg > /etc/apt/keyrings/cloud.google.gpg \
|
||||
&& chmod go+r /etc/apt/keyrings/cloud.google.gpg \
|
||||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee /etc/apt/sources.list.d/google-cloud-sdk.list > /dev/null \
|
||||
&& apt-get update -y \
|
||||
&& apt-get install google-cloud-cli -y
|
||||
|
||||
# Set up the dev user (password is "password").
|
||||
RUN useradd -rm -d /home/dev -s /usr/bin/zsh -g root -G sudo -u 1000 dev && echo 'dev:password' | chpasswd
|
||||
|
||||
# Install rustup as the dev user.
|
||||
RUN su - dev -c "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y"
|
||||
|
||||
# Set some useful environment variables for the dev user.
|
||||
RUN su - dev -c "echo 'export CARGO_TARGET_DIR=/home/dev/cargo-output\nexport DISPLAY=host.docker.internal:0\nexport XDG_RUNTIME_DIR=/run/user/dev' >> /home/dev/.zshenv"
|
||||
|
||||
# Generate the basic english, UTF-8 locale.
|
||||
RUN locale-gen en_US.UTF-8
|
||||
|
||||
# Create the necessary runfiles directory for sshd to work.
|
||||
RUN mkdir -p /run/sshd
|
||||
|
||||
# Enable the sshd service, exposing port 22 to the host.
|
||||
RUN systemctl enable ssh
|
||||
EXPOSE 22
|
||||
|
||||
# Install the Rust toolchain used to build Warp.
|
||||
COPY rust-toolchain.toml /home/dev/setup/rust-toolchain.toml
|
||||
RUN su - dev -c "cd /home/dev/setup && rustup toolchain install"
|
||||
|
||||
# Install Warp-on-Linux dependencies.
|
||||
COPY script/linux/install_test_deps /home/dev/setup/linux/install_test_deps
|
||||
COPY script/linux/install_runtime_deps /home/dev/setup/linux/install_runtime_deps
|
||||
COPY script/linux/install_build_deps /home/dev/setup/linux/install_build_deps
|
||||
COPY script/install_cargo_test_deps /home/dev/setup/script/install_cargo_test_deps
|
||||
COPY script/install_cargo_build_deps /home/dev/setup/script/install_cargo_build_deps
|
||||
COPY script/install_rust /home/dev/setup/script/install_rust
|
||||
|
||||
|
||||
# Run sshd.
|
||||
CMD ["/usr/sbin/sshd", "-D"]
|
||||
@@ -0,0 +1,58 @@
|
||||
# Dockerfile for Linux Development
|
||||
|
||||
The Dockerfile in this directory defines a container that has all of the necessary tools installed to quickly get engineers up and running with building Warp on Linux.
|
||||
|
||||
This container is based on Debian Sid, Debian's unstable branch. It ensures that you are running the latest versions of things like `mesa` (an open-source 3D graphics library, providing implementations of OpenGL and Vulkan).
|
||||
|
||||
## Prerequisites
|
||||
|
||||
You'll need to install:
|
||||
* Docker (e.g.: Docker Desktop)
|
||||
* XQuartz (download [here](https://www.xquartz.org/))
|
||||
* You'll want to enable iGLX (indirect GL extensions) for proper rendering by running `defaults write org.xquartz.X11 enable_iglx -bool true`; you can do this before you install XQuartz.
|
||||
* After installing XQuartz, run it, and enable "Allow connections from network clients" in the Security tab in its settings. You'll need to quit and relaunch XQuartz after making this change.
|
||||
|
||||
## Setup
|
||||
|
||||
You'll run all of these commands from the `warp-internal` repository's root directory.
|
||||
|
||||
First, build the docker container image:
|
||||
|
||||
```
|
||||
CONTAINER_NAME="warp-client-linux-dev"
|
||||
docker build -t $CONTAINER_NAME docker/linux-dev
|
||||
```
|
||||
|
||||
Next, run the container:
|
||||
|
||||
```
|
||||
# The path to the source code directory that you want to mount in the
|
||||
# container. This can be the `warp-internal` repository or some parent
|
||||
# directory of your choice.
|
||||
LOCAL_PATH="/Users/$USER/src"
|
||||
|
||||
# Run the image as a container, bridging port 22 for SSH connections,
|
||||
# mounting the provided directory into the container as `/src`, mounting
|
||||
# your SSH key directory into the container (so you don't need to create a
|
||||
# new GitHub SSH key), and mounting gcloud configuration (and auth information,
|
||||
# so you can run SSH integration tests).
|
||||
docker run -dp 127.0.0.1:22:22/tcp -v $LOCAL_PATH:/src -v $HOME/.ssh:/home/dev/.ssh -v $HOME/.config/gcloud:/home/dev/.config/gcloud $CONTAINER_NAME
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Every time you start XQuartz, you'll need to run this once in order for programs running in the container to connect to it:
|
||||
|
||||
```
|
||||
xhost +localhost
|
||||
```
|
||||
|
||||
You should be able to SSH into the container and build and run warp without any additional setup (dev account password is "password"):
|
||||
|
||||
```
|
||||
ssh dev@localhost
|
||||
cd /src
|
||||
cargo run --features fast_dev
|
||||
```
|
||||
|
||||
It's possible you'll run into some odd errors while trying to compile Warp; if so, just keep rerunning the cargo command and it should work eventually.
|
||||
Reference in New Issue
Block a user