- terraform-docs:
- Generate documentation from Terraform modules in various output formats.
- Can be imported in your project as a library (Go).
- GitHub Actions available (terraform-docs/gh-actions@main)
- mkdocs-terraform-monorepo-plugin
- This plugin enables you to build multiple sets of documentation in a single Mkdocs
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
from tabulate import tabulate | |
def get_fargate_spot_cost(region, vcpu_cost=None, gb_cost=None): | |
""" | |
If vcpu_cost and vcpu_cost are 'None', the current value is retrived from AWS | |
""" | |
import requests | |
endpoint = "https://dftu77xade0tc.cloudfront.net/fargate-spot-prices.json" | |
try: | |
if vcpu_cost is not None and gb_cost is not None: |
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
vcpu_used_by_instance = 1 # Resource used by sh-runner-small-teamS-ruby | |
gb_used_by_instance = 4 # Resource used by sh-runner-small-teamS-ruby | |
vcpu_hourly_rate = 0.04048 # Cost per vCPU hour | |
gb_hourly_rate = 0.004445 # Cost per GB-hour of RAM | |
workflow_executions = 150 # Number of monthly executions | |
jobs_per_execution = 30 # Number of jobs per execution | |
job_duration_hours = 0.0667 # Duration of each job in hours (4 min) | |
start_time_hours = 0.0333 # Start time in hours (2 min) | |
optimization_percentage = 0.72 # Start time optimization percentage | |
hourly_cost_fargate_instance = (vcpu_hourly_rate * vcpu) + (gb_hourly_rate * gb) |
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
import plotly.graph_objects as go | |
import sqlite3 | |
conn = sqlite3.connect('ecs_data_v1.sqlite') | |
conn_v2 = sqlite3.connect('ecs_data_v2.sqlite') | |
cursor = conn.cursor() | |
cursor_v2 = conn_v2.cursor() |
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
import boto3 | |
import sqlite3 | |
from datetime import datetime | |
from dateutil import tz | |
CLUSTER = 'sh-runners' | |
REGION = 'us-east-1' | |
ecs_client = boto3.client('ecs', region_name=REGION) |
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
name: SOCI | |
on: [push] | |
env: | |
NERDCTL_VERSION: "1.6.2" | |
SOCI_VERSION: "0.4.0" | |
jobs: | |
build-push: | |
name: Build and push image | |
runs-on: ubuntu-latest | |
steps: |
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
export AWS_REGION=us-east-1 | |
export REGISTRY_USER=AWS | |
export REGISTRY_PASSWORD=$(aws ecr get-login-password --region $AWS_REGION) | |
export REGISTRY=000000000000.dkr.ecr.$AWS_REGION.amazonaws.com | |
# needed the SOCI snapshotter which runs as root | |
echo $REGISTRY_PASSWORD | sudo nerdctl login -u $REGISTRY_USER --password-stdin $REGISTRY | |
# Pull and push image | |
sudo nerdctl pull docker.io/library/rabbitmq:latest |
- K8s, MicroK8s and Netmaker
Type | Limitation | Solution |
---|---|---|
Etcd | It is the brain of your cluster and is not latency tolerant. | MicroK8s |
Networking | Nodes need to be able to talk to each other directly and securely. | Netmaker |
Latency | High latency is unacceptable for enterprise applications. | Netmaker |
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
#!/usr/bin/env python3 | |
import urllib.request | |
import urllib.parse as req_parse | |
import os | |
import json | |
GITHUB_API = os.getenv("GITHUB_API", "https://api.github.com/{}") | |
RUNNER_SCOPE = os.getenv("GITHUB_API", "repo") | |
GITHUB_OWNER = os.getenv("GITHUB_OWNER") |
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
mkdir /home/ubuntu/sobreplanos | |
aws s3 cp s3://sobreplanos-boilerplate/artifacts/sobreplanos.zip /home/ubuntu/sobreplanos.zip | |
cd /home/ubuntu/ | |
unzip sobreplanos.zip -d sobreplanos | |
rm -rf sobreplanos.zip | |
cd sobreplanos | |
chown -R ubuntu:ubuntu /home/ubuntu | |
export PATH="/usr/share/rvm/rubies/ruby-2.6.8/lib/ruby/gems/2.6.0:/usr/share/rvm/gems/ruby-2.6.8@sobreplanos:/usr/share/rvm/gems/ruby-2.6.8@global/bin:/usr/share/rvm/rubies/ruby-2.6.8/bin:/usr/share/rvm/bin:/home/ubuntu/.nvm/versions/node/v14.15.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ubuntu/sobreplanos/bin:$PATH" | |
echo "##### INSTALL" | |
RAILS_ENV=production bundle install |
NewerOlder