aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <code@jaseg.net>2021-02-07 15:08:15 +0100
committerjaseg <code@jaseg.net>2021-02-07 15:08:15 +0100
commita4888799a8182d71a46422426ffd25cc18c3c92b (patch)
tree1fbd377a5d502dc4b4493a5e3e4ae30f7bdea2ff
parent92f9ae6cd7c82bf3f6e2c69b5de6da4319b5efa6 (diff)
downloadinfra-a4888799a8182d71a46422426ffd25cc18c3c92b.tar.gz
infra-a4888799a8182d71a46422426ffd25cc18c3c92b.tar.bz2
infra-a4888799a8182d71a46422426ffd25cc18c3c92b.zip
Work on gerblyze deploy
now fails when the oom killer reaps the gerbolyze svg-flatten compiler job during pip install.
-rw-r--r--bootstrap_arch_container.yml4
m---------checkouts/gerbolyze0
-rwxr-xr-xrender.sh.j213
-rw-r--r--setup_gerboweb.yml14
-rwxr-xr-xvector.sh.j22
5 files changed, 21 insertions, 12 deletions
diff --git a/bootstrap_arch_container.yml b/bootstrap_arch_container.yml
index dfe677b..c115539 100644
--- a/bootstrap_arch_container.yml
+++ b/bootstrap_arch_container.yml
@@ -13,9 +13,9 @@
- name: Download arch bootstrap image
get_url:
- url: http://mirror.rackspace.com/archlinux/iso/2020.03.01/archlinux-bootstrap-2020.03.01-x86_64.tar.gz
+ url: http://mirror.rackspace.com/archlinux/iso/2021.02.01/archlinux-bootstrap-2021.02.01-x86_64.tar.gz
dest: /tmp/arch-bootstrap.tar.xz
- checksum: sha256:49c7aa8718e48f5a4ec570624520fa50616ed3e044af101ec3aa16c155136f82
+ checksum: sha256:90afa6b420f5d171de71fdd11fc4f10a4ef30fdf61e4f3733958bea7bdbc0fa9
when: create_container is changed
- name: Create container image filesystem
diff --git a/checkouts/gerbolyze b/checkouts/gerbolyze
-Subproject cfcf4c53955a70e896511e30cda206c1dd08109
+Subproject be6783e8034a14721131cb30ee5afded50095a4
diff --git a/render.sh.j2 b/render.sh.j2
index ceb837d..beed8f1 100755
--- a/render.sh.j2
+++ b/render.sh.j2
@@ -9,12 +9,9 @@ systemd-nspawn \
-x --bind={{gerboweb_cache}}/upload/$ID:/mnt \
/bin/sh -c "set -euo pipefail
unzip -j -d /tmp/gerber /mnt/gerber.zip
-rm -f /mnt/render_top.png /mnt/render_bottom.png /mnt/render_top.small.png /mnt/render_bottom.small.png
-date; echo 'Rendering bottom layer'
-gerbolyze render top /tmp/gerber /mnt/render_top.png
+rm -f /mnt/template_top.svg /mnt/template_bottom.svg /mnt/template_top.preview.png /mnt/template_bottom.preview.png
+date; echo 'Rendering'
+gerbolyze template --top /mnt/template_top.svg --bottom /mnt/template_bottom.svg /tmp/gerber
date; echo 'Scaling down'
-convert /mnt/render_top.png -resize 500x500 -negate -brightness-contrast 30x30 -colorspace gray /mnt/render_top.small.png
-date; echo 'Rendering top layer'
-gerbolyze render bottom /tmp/gerber /mnt/render_bottom.png
-date; echo 'Scaling down'
-convert /mnt/render_bottom.png -resize 500x500 -negate -brightness-contrast 30x30 -colorspace gray /mnt/render_bottom.small.png"
+convert /mnt/template_top.svg -resize 500x500 -negate -brightness-contrast 30x30 -colorspace gray /mnt/template_top.preview.png
+convert /mnt/template_bottom.svg -resize 500x500 -negate -brightness-contrast 30x30 -colorspace gray /mnt/template_bottom.preview.png
diff --git a/setup_gerboweb.yml b/setup_gerboweb.yml
index 428cb98..35be726 100644
--- a/setup_gerboweb.yml
+++ b/setup_gerboweb.yml
@@ -16,7 +16,19 @@
mode: ug+x
- name: Install packages into gerbolyze container
- shell: arch-chroot "{{gerboweb_root}}" pacman -Syu --noconfirm python3 opencv hdf5 gtk3 python-numpy python-pip imagemagick unzip zip
+ shell: arch-chroot "{{gerboweb_root}}" pacman -Syu --noconfirm python3 python-numpy python-pip imagemagick unzip zip pugixml opencv pango cairo git python make clang rustup cargo pkgconf
+
+- name: Install rust
+ shell: arch-chroot "{{gerboweb_root}}" rustup install stable
+
+- name: Setup rust
+ shell: arch-chroot "{{gerboweb_root}}" rustup default stable
+
+- name: Setup usvg
+ shell: arch-chroot "{{gerboweb_root}}" cargo install usvg
+
+- name: Setup pcb-tools-extension
+ shell: arch-chroot "{{gerboweb_root}}" pip install git+https://git.jaseg.de/pcb-tools-extension.git
- name: Workaround for cairoffi problem
shell: arch-chroot "{{gerboweb_root}}" pip install -U --upgrade-strategy=eager wheel
diff --git a/vector.sh.j2 b/vector.sh.j2
index b17116e..b007967 100755
--- a/vector.sh.j2
+++ b/vector.sh.j2
@@ -12,7 +12,7 @@ systemd-nspawn \
/bin/sh -c "set -euo pipefail
cd /tmp
unzip -j -d gerber_in /mnt/gerber.zip
-gerbolyze vectorize $LAYER gerber_in gerber /mnt/overlay.png
+gerbolyze paste "--"$LAYER /mnt/overlay.svg gerber_in gerber
rm -f /mnt/gerber_out.zip
zip -r /mnt/gerber_out.zip gerber"