Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Andrey Arapov arno01

🎯
Focusing
View GitHub Profile
@arno01
arno01 / partially-reconstruct-manifests-akash-provider.md
Last active Jun 2, 2022
Partially reconstruct manifests in the event you lost them but still have actual deployment pods running
View partially-reconstruct-manifests-akash-provider.md

Partially reconstruct manifests in the event you lost them but still have actual deployment pods running.

Here is how you can partially reconstruct the deleted manifests to make sure your provider will keep monitoring them, withdrawing from their leases as well as allow users to re-send their deployment manifest (without redeploying) to restore it & their ingresses (uri's), avoiding the Pod restart, hence keeping the ephemeral data on a Pod.

1. Partially reconstruct missing manifests

This reconstruction is based on existing namespaces, there is no way to entirely reconstruct the manifests unless they were manually backed up.

View list-providers-region.md

List all regions

$ akash query provider list --limit 1000 -o json | jq -r '.providers[] | (.attributes[] | select(.key == "region") | .value)' | sort | uniq -c | sort -n
      1 ap-northeast-1
      1 ap-southeast
      1 australia-east-akash-provider
      1 Chicago
      1 cz-prague
      1 cz-prague2
@arno01
arno01 / akash-provider-safeguard-script.md
Last active Aug 2, 2022
Akash provider safeguard script against freeloaders
View akash-provider-safeguard-script.md

Akash Provider safeguard script against freeloaders

This script issues akash tx market lease withdraw only against leases which ran out of balance.

Motivation

The deployment gets automatically closed when it runs out of balance in escrow account. But the balance settlement occurs only after a lease withdraw transaction.

Without timely withdrawal from the escrow accounts freeloaders can deploy an expensive deployment

View akash-0.16.0.md
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x15380b3]

goroutine 112 [running]:
github.com/cosmos/cosmos-sdk/x/upgrade.BeginBlocker({{0xc00013ab80, 0xc}, 0xc00113fda0, {0x308b7f0, 0xc00131ef60}, {0x311ffd8, 0xc00131f110}, 0xc001380f90, {0x3070bc0, 0xc001185520}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.1/x/upgrade/abci.go:38 +0x1093
github.com/cosmos/cosmos-sdk/x/upgrade.AppModule.BeginBlock(...)
	github.com/cosmos/cosmos-sdk@v0.45.1/x/upgrade/module.go:130
github.com/cosmos/cosmos-sdk/types/module.(*Manager).BeginBlock(_, {{0x30d4468, 0xc0000520c0}, {0x3127000, 0xc004213900}, {{0xb, 0x0}, {0xc003ae5060, 0xa}, 0x5548a6, ...}, ...}, ...)
View ssh-akash.md
---
version: "2.0"

services:
  ssh:
    image: ubuntu:22.04
    env:
      - 'SSH_PUBKEY=ssh-rsa AAAAB3Nza......'
    command:
View presearch-on-akash.md
View vpn-akash.md

Simple VPN over SSH with shuttle in Akash

ssh server

  • deploy.yaml:
---
version: "2.0"
View Install kubespray in Ubuntu 16.04.md

Still errors. I believe python3.5 is way too old for the Ansible. I suggest latest stable Ubuntu version.

sudo apt update
sudo apt -y install git python3-venv locales gcc libffi-dev libssl-dev python3-dev
sudo locale-gen en_US.UTF-8

export LC_ALL=en_US.UTF-8
View gist:036aebfde71a9a553519dfc5a6c6ef8b
curl -k -X GET \
-H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \
https://$KUBERNETES_PORT_443_TCP_ADDR:$KUBERNETES_SERVICE_PORT_HTTPS
View akash-ssh.md
---
version: "2.0"

services:
  sshd:
    image: ubuntu:21.10
    env:
      - 'SSH_PUBKEY=ssh-rsa AAAAB3...YOUR_PUBLIC_SSH_KEY ogp8='
    command: