Skip to content

Commit

Permalink
fix: ladder live check and reduce ladderzip time by pre-installing sc2ai
Browse files Browse the repository at this point in the history
  • Loading branch information
dysonreturns committed Feb 7, 2024
1 parent d957525 commit 3726198
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/docker_build/Dockerfile.ruby
Expand Up @@ -50,16 +50,20 @@ RUN rm ./libgfortran5*.deb

RUN /root/ruby-builder/.ruby/bin/ruby --yjit -v

ENV PATH "/root/ruby-builder/.ruby/bin:$PATH"
RUN gem install 'sc2ai'

#RUN apt remove --assume-yes rustc curl build-essential libssl-dev zlib1g-dev libgmp-dev uuid-dev

FROM debian:12-slim
COPY --from=build /root/ruby-builder /root/ruby-builder

RUN /root/ruby-builder/.ruby/bin/ruby --yjit -v

#RUN apt remove --assume-yes rustc curl build-essential libssl-dev zlib1g-dev libgmp-dev uuid-dev
RUN apt-get update
RUN apt-get purge $(aptitude search '~i!~M!~prequired!~pimportant!~R~prequired!~R~R~prequired!~R~pimportant!~R~R~pimportant!busybox!grub!initramfs-tools' | awk '{print $2}') --assume-yes
RUN apt-get purge aptitude --assume-yes
RUN apt install zip openssl --assume-yes
RUN apt-get install zip openssl build-essential libopenblas0-serial --assume-yes
RUN apt-get autoremove --assume-yes
RUN apt-get clean --assume-yes

Expand Down
3 changes: 3 additions & 0 deletions lib/sc2ai/cli/cli.rb
Expand Up @@ -91,6 +91,7 @@ def setup410

desc "ladderconfig", "Prints out how you're configured for the ladder."
def ladderconfig
require "sc2ai"
unless Pathname("./boot.rb").exist?
raise Sc2::Error, "boot.rb not found. Bot started from wrong directory."
end
Expand Down Expand Up @@ -131,6 +132,8 @@ def ladderconfig
option :OpponentId, desc: "Unique identifier"
option :RealTime, type: :boolean, default: false, desc: "Forces realtime flag"
def laddermatch
require "sc2ai"

unless Sc2.ladder?
raise Sc2::Error, "This command is only for competing on aiarena.net"
end
Expand Down

0 comments on commit 3726198

Please sign in to comment.