Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: broadly, allows
sc2ai new
and sc2ai ladderzip
A lot of refactoring and additions needed to allow lader play, including a templated start directory. feature: Adding templates for sc2ai new and sc2ai ladderzip feature: Paths#template_root for template sources feature: during init callback to Bot#configure to define additional attributes feature: enable_feature_layer/interface_options removed from join_game and added as attributes feature: removed enable_feature_layer from Sc2 config, and forcing it via Bot#configure feature: Sc2#is_live? reads bin/ladder env "AIARENA" to toggle live or not feature: moved /data/replays to ./replays/
- Loading branch information
1 parent
5f055c7
commit 4ca8c2b
Showing
34 changed files
with
2,510 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env ruby | ||
|
||
# Builds image used in ladderzip | ||
|
||
puts "This command builds the base image with semi-portable ruby for the server." | ||
require "pathname" | ||
|
||
compose_file = Pathname(__FILE__).parent.parent | ||
.join("lib", "docker_build", "docker-compose-base-image.yml") | ||
.expand_path | ||
cmd = "docker compose --progress=plain -f #{compose_file.to_s} build" | ||
puts cmd | ||
Kernel.exec(cmd) | ||
|
||
puts "Ruby can be found in the image at: /root/ruby-builder/.ruby" | ||
|
||
# If you need to use the ruby on the container, | ||
# export PATH=/root/ruby-builder/.ruby/bin:$PATH | ||
# To allow access to ruby/bunder/etc. | ||
# Or simply execute a ruby command directly: /root/ruby-builder/.ruby/bin/ruby -v |
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,51 +1,36 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
$LOAD_PATH.unshift(File.expand_path("lib")) # TODO: REMOVE | ||
# require "pathname" | ||
# $LOAD_PATH.unshift(Pathname(File.dirname(__FILE__)).parent.join("lib").expand_path.to_s) | ||
|
||
require "sc2ai" | ||
require "sc2ai/cli/cli" | ||
|
||
puts <<-LOGO | ||
...',;:clooc;'. .':loocc:;,'.. | ||
.,lxkkOOO0OOOOOOOkoc;'. .':ldkOOOOOOOOOOOkkdc, | ||
.,:okOOOOOOOOOOOOOOOkdl, ,ldkOOOOOOOOOOOOOOOko:'. | ||
.;lkOOOOOOOOOOOOOO0o. .d0OOOOOOOOOOOOOOxl,. | ||
.;dOOOOOOOOOOOO0o. .d0OOOOOOOOOOOOo;. | ||
.cOOOOOOOOOOO0o. .d0OOOOOOOOOOk: | ||
.x0OOOOOOOOO0o. .d0OOOOOOOOO0d. | ||
.............:OKKKKKKKKKKKx;. .d0OOO0000000d' .................. | ||
.dKXNXXXXXXXXXXNWMWWMWMMMMWMNk; .d00XNWWWWWWWNK00000000000000000Oo' | ||
.xMMMMMMMMMMMMMMMMMMMMMMMMMMWO' .xXNMMMMMMMMMMMMMMMMMMMMMMMMMWKd,. | ||
.o0O000000000000KNNNNWWMMMWNKo. ,KWNWNNWWWNWWN00000000OKNMWXx;. | ||
,x0O00KNWNKOOo. .x0OOO00000O0d. .:d:. | ||
.:ccllllllcl;;x0OOOO000OO0o. .,:xKNXXXXXNX0O0d. | ||
:OWMMMMMMMMWK00OOOOOOOOO0o. cKNMMMMMMMMMN0O0o. ... ... | ||
.lKWMMMMMMMMWX0OOOOOOOO0o..kMMMMMMMMMMMN0O0o. ,ok0KKd. lKKK: | ||
.dNMMMMMMMMMWK0OOOOOOOo.'0MMMMMMMMMMMXOO0o. .lkkx0WMNl .xMMWo | ||
,kNMMMMMMMMMNKOOOOO0o.,KMMMMMMMMMMMXOO0o. oWWo .xWMK, .xMMMo | ||
.:0WMMMMMMMMWX0OOO0o.'0MMMMMMMMMMMN0O0o. :XMXo;;;xWMx. .xMMWo | ||
.oXMMMMMMMMMNKOO0o..dWWMMMMMMMMMWKO0o. .OMNOkkkl;kMNl .xMMWo | ||
'xNMMMMMMMMWX00o. ,d0MMMMMMMMMMN00d. oWWo. ,KMK,.xMMX; | ||
:KWMMMMMMMMWXo. :XMMMMMMMMMMNKd. ,:;. '::. :KK: | ||
.:kkc. .l0NMMMMMMMMM0; :XMMMMMMMMMMWO' .' | ||
.c0WMMWX0kkkkkkkOKXNMMMMMMMMMMXc .xXWMMMMMMMMMWKd:. | ||
.lKWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMO. .d00XWMMMMMMMMMMWXOxolclc. | ||
'dXMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWK: .dOOO0KXNWMMMMMMMMMMWN0d; | ||
':::::::::::::::::::o0XKKKKKKKKKXk' .d0OOOOO0KKXXKxoool:;.. | ||
.d0OOOOOOOOO0o. .d0OOOOOOOOOOo. | ||
;kOOOOOOOOO0o. .d0OOOOOOOOOk, | ||
;xOOOOOOOO0o. .d0OOOOOOOOx, | ||
.lkOOOOOO0o. .d0OOOOOOkc. | ||
.lkOOOO0o. .d0OOOOkc. | ||
.:dOO0o. .dOOOd:. | ||
.,lko. .dkl,. | ||
.. .. | ||
LOGO | ||
# This got old quickly. | ||
# puts <<-LOGO | ||
# | ||
# .:^~!77?7~:. .:~7?77!~^:. | ||
# .:~?JYJJJJJJ?7~. .!7JJJJJJJYJ?~: | ||
# .^?JJJJJJJY: ^YJJJJJJJ?^. | ||
# 7JJJJJJJ. ^JJJJJJJ7 | ||
# .^^^^^^^^YPPPPPPP?. :JJ55555?.:::::::::::. | ||
# 7@@@@@@@@@@@@@&&@&J ^G#&&&&&@@@@@@@@@@&G!. | ||
# ^77!!!!!!!PGGB&&BY. !BGGGGGGP77777?BG7. | ||
# ~??777?~7JJJYYJJ: !PBBBBBYJ~ | ||
# J&@@@@@&PJJJJJJ..&@&&&&&YJ~ ~PGJ JG? | ||
# .Y&@&&&&#YJJJJ.!@&&&&&&JJ~ .#P @@! &@# | ||
# .P&&&&&&GJJJ.^@&&&&&&YJ~ @#G77@@. #@# | ||
# ^B&&&&&&PJ. B@&&&&&BJ~ 7@J.: :@B #@5 | ||
# ~: Y&&&&&&#^ .B@&&&&&#! . :J | ||
# 7#@&BPPPPPB&&&&&&&&! ^B&&&&&&&5~. | ||
# .J&@&&&&&&&&&&&&&&&&&&! :JYP#&&&&@@&&B5^ | ||
# .:...........?5555555^ ^JJJJY5PJ^^:. | ||
# .JJJJJJJ: ^JJJJJJJ. | ||
# .!JJJJJ: ^JJJJJ! | ||
# .!JJY: ^YJJ~. | ||
# :7. :7: | ||
# | ||
# LOGO | ||
|
||
Sc2::Cli.start |
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,61 @@ | ||
FROM aiarena/arenaclient-bot:latest | ||
LABEL service="bot-ruby-local" | ||
|
||
USER root | ||
WORKDIR /root/ruby-builder | ||
|
||
ARG RUBY_VERSION=3.3.0 | ||
ARG DEBIAN_DISABLE_RUBYGEMS_INTEGRATION=true | ||
|
||
# Deps - Ruby build | ||
RUN apt-get update | ||
RUN apt install --assume-yes rustc curl build-essential libssl-dev zlib1g-dev libgmp-dev uuid-dev | ||
|
||
# Deps - libyaml from source | ||
RUN curl https://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz -o yaml-0.2.5.tar.gz | ||
RUN tar -zxf yaml-0.2.5.tar.gz | ||
|
||
# Ruby | ||
RUN mkdir -p /root/ruby-builder/.ruby | ||
RUN curl https://cache.ruby-lang.org/pub/ruby/3.3/ruby-$RUBY_VERSION.tar.gz -o ruby-$RUBY_VERSION.tar.gz | ||
RUN tar -zxf ruby-$RUBY_VERSION.tar.gz | ||
RUN mkdir ruby-$RUBY_VERSION/build | ||
WORKDIR /root/ruby-builder/ruby-$RUBY_VERSION/build | ||
RUN ../configure --prefix="/root/ruby-builder/.ruby" --disable-install-doc --enable-shared --enable-load-relative --with-libyaml-source-dir=/root/ruby-builder/yaml-0.2.5 | ||
RUN make install -j8 | ||
|
||
# Clean | ||
WORKDIR /root/ruby-builder | ||
RUN rm ruby-$RUBY_VERSION.tar.gz | ||
RUN rm -rf ./ruby-$RUBY_VERSION | ||
RUN rm yaml-0.2.5.tar.gz | ||
RUN rm -rf ./yaml-0.2.5 | ||
|
||
# Package config | ||
# numo-linalg needs openblas, copy to ruby-prefix/lib/ dir. | ||
RUN apt download libopenblas0-serial | ||
RUN mkdir openblas | ||
RUN dpkg-deb -x ./libopenblas*.deb openblas | ||
RUN cp -d openblas/usr/lib/x86_64-linux-gnu/openblas-serial/* /root/ruby-builder/.ruby/lib/ | ||
RUN rm -rf ./openblas | ||
RUN rm ./libopenblas0-serial*.deb | ||
|
||
RUN apt download libgfortran5 | ||
RUN mkdir libgfortran5 | ||
RUN dpkg-deb -x ./libgfortran*.deb libgfortran5 | ||
RUN find libgfortran5 | ||
RUN cp libgfortran5/usr/lib/x86_64-linux-gnu/libgfortran.so.5 /root/ruby-builder/.ruby/lib/ | ||
RUN rm -rf ./libgfortran5 | ||
RUN rm ./libgfortran5*.deb | ||
|
||
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 | ||
|
||
# Ladder zip | ||
RUN apt install --assume-yes zip | ||
|
||
ENV PATH "/root/ruby-builder/.ruby/bin:$PATH" | ||
|
||
WORKDIR /root/ | ||
|
||
ENTRYPOINT ["/bin/bash"] |
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,10 @@ | ||
version: "3.9" | ||
services: | ||
bot: | ||
image: dysonreturns/aiarena-ruby-builder:latest | ||
environment: | ||
- CPPFLAGS=-DPNG_ARM_NEON_OPT=0 | ||
platform: "linux/amd64" | ||
build: | ||
dockerfile: ./Dockerfile.ruby | ||
|
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,9 @@ | ||
version: "3.9" | ||
services: | ||
bot: | ||
image: dysonreturns/aiarena-ruby-builder:latest | ||
environment: | ||
- CPPFLAGS=-DPNG_ARM_NEON_OPT=0 | ||
platform: "linux/amd64" | ||
tty: true | ||
|
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
Oops, something went wrong.