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

FEATURE: Add early support for aarch64 in dev env #765

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions image/auto_build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def dev_deps()
"sed -e 's/\(db_name: discourse\)/\1_development/' ../templates/postgres.template.yml > discourse_dev/postgres.template.yml",
)
run("cp ../templates/redis.template.yml discourse_dev/redis.template.yml")
run("cp base/install-rust discourse_dev/install-rust")
end

if ARGV.length != 1
Expand Down
2 changes: 1 addition & 1 deletion image/base/install-rust
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
export RUSTUP_HOME=/usr/local/rustup
export CARGO_HOME=/usr/local/cargo
export PATH=/usr/local/cargo/bin:$PATH
export RUST_VERSION=1.68.0
export RUST_VERSION=1.75.0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to update to the latest version of rust to be able to compile selenium-manager.

export RUSTUP_VERSION=1.25.2

dpkgArch="$(dpkg --print-architecture)"
Expand Down
10 changes: 5 additions & 5 deletions image/discourse_dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ RUN mv /shared/postgres_data /shared/postgres_data_orig
# invocations when used with a mounted volume)
ADD ensure-database /etc/runit/1.d/ensure-database

RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - &&\
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list &&\
apt update &&\
apt install -y google-chrome-stable firefox-esr
ADD install-rust /tmp/install-rust
ADD install-selenium /tmp/install-selenium
RUN /tmp/install-selenium

# Install & Configure MailHog (https://github.com/mailhog/MailHog)
RUN wget -qO /tmp/mailhog https://github.com/mailhog/MailHog/releases/download/v1.0.1/MailHog_linux_amd64\
&& echo "e2ed634ded49929f089b20045581955ed217672078fd86082dd7a6c67c5d09c7 /tmp/mailhog" | sha256sum -c -\
&& mv /tmp/mailhog /usr/local/bin/mailhog\
&& chmod +x /usr/local/bin/mailhog
&& chmod +x /usr/local/bin/mailhog\
&& rm -rf /tmp/*
28 changes: 28 additions & 0 deletions image/discourse_dev/install-selenium
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
set -e

# The chrome webdriver isn’t available for the aarch64 architecture (yet). We
# have to rely on the geckodriver instead, so we’re just installing firefox and
# not even chromium.
# The Selenium gem isn’t shipped with the `selenium-manager` binary for aarch64
# either (yet). So we have to compile it ourselves.
if [ "$(dpkg --print-architecture)" = "arm64" ]; then
apt update && apt install -y firefox-esr
cd /tmp
/tmp/install-rust
git clone --depth 1 --no-checkout https://github.com/SeleniumHQ/selenium.git
cd selenium
git sparse-checkout set rust
git checkout
cd rust
cargo build --release
cp target/release/selenium-manager /usr/local/bin
rustup self uninstall -y
cd /
rm -rf /tmp/*
else
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - &&\
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list &&\
apt update &&\
apt install -y google-chrome-stable firefox-esr
fi
Loading