@@ -67,6 +67,9 @@ inputs:
6767 bot_token :
6868 description : ' The monitor token'
6969 required : false
70+ live_token :
71+ description : ' The trading token'
72+ required : false
7073 logs_token :
7174 description : ' The warning token'
7275 required : false
97100 id : variables
98101 shell : bash
99102 run : |
100- brew update --quiet
103+ brew update --quiet && brew uninstall cmake
101104 brew install --quiet coreutils doxygen pandoc gsl cmake ninja lcov gcc@12 qt@5 texlive
102105 brew info qt@5 && brew info gsl
103106 IFS=', '; array=($(curl -L -s 'https://registry.hub.docker.com/v2/repositories/${{ inputs.image_name }}/tags?page_size=1024' | jq -rc '."results"[]["name"]' | yq eval -P | sed "s/ /, /g"))
@@ -118,11 +121,13 @@ runs:
118121 #cloud-config
119122 users:
120123 - default
121- - uid: 1000
122- name: runner
123- groups: admin,adm,video,docker,google-sudoers
124124
125125 write_files:
126+ - path: /home/runner/.docker/.keep
127+ permissions: "0755"
128+ owner: root
129+ content: ""
130+
126131 - path: /etc/systemd/system/firewall.service
127132 permissions: "0644"
128133 owner: root
@@ -151,7 +156,7 @@ runs:
151156 ExecStop=/usr/bin/docker stop runner1
152157 ExecStopPost=/usr/bin/docker rm runner1
153158 ExecStartPre=/usr/bin/docker-credential-gcr configure-docker
154- ExecStart=/usr/bin/docker run --rm -e RUNNER_REPLACE_EXISTING=true -e RUNNER_NAME=${{ env.RUNNER_TITLE }} -e RUNNER_REPOSITORY_URL=https://github.com/${{ env.TARGET_REPOSITORY }} -e GITHUB_ACCESS_TOKEN =${{ inputs.token }} -e CONTAINER_NAME=runner1 -v /home/runner/.docker:/home/runner/.docker -v /mnt:/mnt -v /var/log:/host/var/log -v /etc/systemd:/host/etc/systemd -v /var/run/docker.sock:/var/run/docker.sock --name runner1 --pull=always eq19/maps:target-${{ github.run_number }}
159+ ExecStart=/usr/bin/docker run --rm -e REPOSITORY=${{ inputs.repository }} -e RUNNER_REPLACE_EXISTING=true -e RUNNER_NAME=${{ env.RUNNER_TITLE }} -e RUNNER_REPOSITORY_URL=https://github.com/${{ env.TARGET_REPOSITORY }} -e GH_TOKEN =${{ inputs.token }} -e CONTAINER_NAME=runner1 -v /home/runner/.docker:/home/runner/.docker -v /mnt:/mnt -v /var/log:/host/var/log -v /etc/systemd:/host/etc/systemd -v /var/run/docker.sock:/var/run/docker.sock --memory=256M --memory-swap=2G --name runner1 --pull=always eq19/maps:target-${{ github.run_number }}
155160
156161 - path: /etc/systemd/system/mydb.service
157162 permissions: "0644"
@@ -167,7 +172,7 @@ runs:
167172 Environment="HOME=/home/runner"
168173 ExecStop=/usr/bin/docker exec mydb -s quit
169174 ExecStartPre=/usr/bin/docker-credential-gcr configure-docker
170- ExecStart=/usr/bin/docker run --rm -e POSTGRES_DB=postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e TELEGRAM_CHAT_ID= ${{ inputs.chat_id }} -e MONITOR_BOT_TOKEN =${{ inputs.bot_token }} -e WARNING_BOT_TOKEN=${{ inputs.logs_token }} - v /mnt:/mnt --memory=512M --memory-swap=1G --name=mydb -p 5432:5432 --pull=always eq19/feed:spin-${{ env.IMAGE_TAG }}
175+ ExecStart=/usr/bin/docker run --rm -e REPOSITORY= ${{ inputs.repository }} -e GH_TOKEN =${{ inputs.token }} -e POSTGRES_DB=postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres - v /mnt:/mnt --memory=512M --memory-swap=10G --name=mydb -p 5432:5432 --pull=always eq19/feed:spin-${{ env.IMAGE_TAG }}
171176
172177 - path: /etc/systemd/system/runner2.service
173178 permissions: "0644"
@@ -185,7 +190,25 @@ runs:
185190 ExecStop=/usr/bin/docker stop runner2
186191 ExecStopPost=/usr/bin/docker rm runner2
187192 ExecStartPre=/usr/bin/docker-credential-gcr configure-docker
188- ExecStart=/usr/bin/docker run --rm -e RUNNER_REPLACE_EXISTING=true -e RUNNER_NAME=${{ env.RUNNER_TITLE }} -e RUNNER_REPOSITORY_URL=https://github.com/${{ inputs.repository }} -e GITHUB_ACCESS_TOKEN=${{ inputs.token }} -e CONTAINER_NAME=runner2 -v /home/runner/.docker:/home/runner/.docker -v /mnt:/mnt -v /var/log:/host/var/log -v /etc/systemd:/host/etc/systemd -v /var/run/docker.sock:/var/run/docker.sock --name runner2 --pull=always eq19/lexer:id-${{ env.IMAGE_TAG }}
193+ ExecStart=/usr/bin/docker run --rm -e REPOSITORY=${{ inputs.repository }} -e RUNNER_REPLACE_EXISTING=true -e RUNNER_NAME=${{ env.RUNNER_TITLE }} -e RUNNER_REPOSITORY_URL=https://github.com/${{ inputs.repository }} -e GH_TOKEN=${{ inputs.token }} -e CONTAINER_NAME=runner2 -v /home/runner/.docker:/home/runner/.docker -v /mnt:/mnt -v /var/log:/host/var/log -v /etc/systemd:/host/etc/systemd -v /var/run/docker.sock:/var/run/docker.sock --memory=256M --memory-swap=2G --name runner2 --pull=always eq19/maps:target-${{ github.run_number }}
194+
195+ - path: /etc/systemd/system/myredis.service
196+ permissions: "0644"
197+ owner: root
198+ content: |
199+ [Unit]
200+ Description=gcloud compute
201+ Wants=myrunner2.service
202+ After=myrunner2.service
203+
204+ [Service]
205+ RestartSec=5s
206+ Restart=on-failure
207+ Environment="HOME=/home/runner"
208+ ExecStop=/usr/bin/docker stop myredis
209+ ExecStopPost=/usr/bin/docker rm myredis
210+ ExecStartPre=/usr/bin/docker-credential-gcr configure-docker
211+ ExecStart=/usr/bin/docker run --rm -e REPOSITORY=${{ inputs.repository }} -e RUNNER_REPLACE_EXISTING=true -e RUNNER_NAME=${{ env.RUNNER_TITLE }} -e RUNNER_REPOSITORY_URL=https://github.com/${{ inputs.repository }} -e GH_TOKEN=${{ inputs.token }} -e CONTAINER_NAME=runner2 -v /home/runner/.docker:/home/runner/.docker -v /mnt:/mnt -v /var/log:/host/var/log -v /etc/systemd:/host/etc/systemd -v /var/run/docker.sock:/var/run/docker.sock --memory=256M --memory-swap=2G --name myredis --pull=always eq19/lexer:id-${{ env.IMAGE_TAG }}
189212
190213 bootcmd:
191214 - fsck.ext4 -tvy /dev/sdb1
@@ -194,7 +217,7 @@ runs:
194217
195218 runcmd:
196219 - systemctl stop docker
197- - fallocate -l 2G /mnt/disks/deeplearning/swapfile || dd if=/dev/zero of=/mnt/disks/deeplearning/swapfile bs=1M count=2048
220+ - fallocate -l 10G /mnt/disks/deeplearning/swapfile || dd if=/dev/zero of=/mnt/disks/deeplearning/swapfile bs=1M count=10240
198221 - chmod 600 /mnt/disks/deeplearning/swapfile
199222 - mkswap /mnt/disks/deeplearning/swapfile
200223 - swapon /mnt/disks/deeplearning/swapfile
@@ -217,8 +240,14 @@ runs:
217240 shell : bash
218241 run : >
219242 gcloud compute instances create grid-${{ env.IMAGE_TAG }}
220- --service-account=project-owner@feedmapping .iam.gserviceaccount.com
243+ --service-account=project-owner@marketleader .iam.gserviceaccount.com
221244 --scopes=https://www.googleapis.com/auth/cloud-platform --deletion-protection
222245 --zone=us-central1-a --machine-type=e2-micro --enable-display-device --tags=https-server
223246 --boot-disk-device-name=cos --image-project cos-cloud --image-family cos-stable --metadata-from-file=user-data=cloud-config
224247 --create-disk=boot=no,auto-delete=yes,name=tensorflow,device-name=deeplearning,mode=rw,size=50,type=pd-standard,image=projects/ml-images/global/images/c0-deeplearning-common-cpu-v20250325-debian-11-py310-conda
248+
249+ - name : ⚧️ Rerun workflow if failed
250+ if : ${{ failure() }}
251+ shell : bash
252+ run : |
253+ [[ "$GITHUB_JOB" == "lexering" ]] && gh workflow run "main.yml" --repo $REPO_NAME --raw-field "REMOVE_RUNNER=$RERUN_RUNNER"
0 commit comments