Skip to content

Commit

Permalink
Install gcc-13 for building lantern on updates, build lantern after u…
Browse files Browse the repository at this point in the history
…pdating docker image
  • Loading branch information
var77 committed Apr 26, 2024
1 parent 38d7ee4 commit adcdda4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion prog/lantern/lantern_server_nexus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ def before_run
when "Succeeded"
vm.sshable.cmd("common/bin/daemonizer --clean update_docker_image")
decr_update_image
hop_init_sql
# Update lantern to build extension with march_native on the machine
hop_update_lantern_extension
when "NotStarted"
vm.sshable.cmd("common/bin/daemonizer 'sudo lantern/bin/update_docker_image' update_docker_image", stdin: JSON.generate({
gcp_creds_gcr_b64: Config.gcp_creds_gcr_b64,
Expand Down
5 changes: 3 additions & 2 deletions rhizome/lantern/bin/update_lantern
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ end

version_tag = "v#{$configure_hash["version"]}"

r "sudo docker exec -u root #{$container_name} bash -c 'apt update && apt install -y build-essential cmake postgresql-server-dev-#{pg_version}'"
r "sudo docker exec -u root #{$container_name} bash -c 'apt update && apt install -y cmake postgresql-server-dev-#{pg_version}'"
r "sudo docker exec -u root #{$container_name} bash -c 'echo \"deb http://deb.debian.org/debian/ sid main\" > /etc/apt/sources.list.d/gcc.list && apt update && apt install -t sid -y gcc-13 g++-13'"
r "sudo docker exec -u root #{$container_name} bash -c 'cd /tmp && rm -rf lantern || true'"
r "sudo docker exec -u root #{$container_name} bash -c 'cd /tmp && git clone https://github.com/lanterndata/lantern.git --recursive'"
r "sudo docker exec -u root #{$container_name} bash -c 'cd /tmp/lantern && git checkout #{version_tag}'"
r "sudo docker exec -u root #{$container_name} bash -c 'cd /tmp/lantern && git submodule update --recursive && mkdir build'"
r "sudo docker exec -u root #{$container_name} bash -c 'cd /tmp/lantern/build && cmake -DBUILD_FOR_DISTRIBUTING=YES -DMARCH_NATIVE=YES ..'"
r "sudo docker exec -u root #{$container_name} bash -c 'cd /tmp/lantern/build && CC=/usr/bin/gcc-13 CXX=/usr/bin/g++-13 cmake -DBUILD_FOR_DISTRIBUTING=YES -DMARCH_NATIVE=ON ..'"
r "sudo docker exec -u root #{$container_name} bash -c 'cd /tmp/lantern/build && make install'"
r "sudo docker exec -u root #{$container_name} bash -c 'rm -rf /tmp/lantern'"
2 changes: 1 addition & 1 deletion spec/prog/lantern/lantern_server_nexus_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@
expect(lantern_server.vm.sshable).to receive(:cmd).with("common/bin/daemonizer --check update_docker_image").and_return("Succeeded")
expect(lantern_server.vm.sshable).to receive(:cmd).with("common/bin/daemonizer --clean update_docker_image")
expect(nx).to receive(:decr_update_image)
expect { nx.update_image }.to hop("init_sql")
expect { nx.update_image }.to hop("update_lantern_extension")
end

it "updates image and fails" do
Expand Down

0 comments on commit adcdda4

Please sign in to comment.