To add a value to a secret we need to ensure it is base64 encoded without whitespace
E.g.
echo -n 'true' | base64 -w0
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "log" | |
| "os" | |
| "github.com/google/generative-ai-go/genai" | |
| "github.com/hectormalot/omgo" |
| from abc import ABC, abstractmethod | |
| import re | |
| from typing import Dict, Any | |
| import json | |
| import requests | |
| from bs4 import BeautifulSoup | |
| class Scraper(ABC): | |
| def parse_site(self, url: str, headers: dict={}) -> Dict[str, Any]: |
| #image processing resources | |
| from skimage.io import imread, imshow | |
| from skimage.filters import gaussian, threshold_otsu | |
| from skimage.feature import canny | |
| from skimage.transform import probabilistic_hough_line, rotate | |
| #testing | |
| import numpy as np | |
| import os |
| from urllib.parse import urlparse | |
| from airflow.providers.amazon.aws.hooks.s3 import S3Hook | |
| from airflow.providers.amazon.aws.operators.s3 import S3FileTransformOperator | |
| def file_from_s3(prefix): | |
| """ | |
| Fetches S3 processed file from remote to local /tmp | |
| to allow inference to run on it | |
| """ |
| from airflow.models.dag import DAG | |
| from airflow.api.client.local_client import Client | |
| from airflow.providers.amazon.aws.sensors.sqs import SqsSensor | |
| def analyze_data(ti): | |
| airflow_client = Client(None, None) | |
| messages = ti.xcom_pull(task_ids="sqs_sensor", key="messages") | |
| for msg in messages: | |
| records = json.loads(msg['Body']) |
| # Change these variables as necessary. | |
| MAIN_PACKAGE_PATH := ./cmd/example | |
| BINARY_NAME := example | |
| # ==================================================================================== # | |
| # HELPERS | |
| # ==================================================================================== # | |
| ## help: print this help message | |
| .PHONY: help |
| // Interval time to check if runtime is disconnected | |
| interval = 1000 * 60; | |
| // Busy/Reconnect button top-right | |
| reloadButton = document.querySelector('#connect > paper-button > span') | |
| setInterval(() => { | |
| if (reloadButton.innerText == 'Reconnect') { | |
| reloadButton.click(); | |
| console.log('Restarting'); |
| raise ClientError(operation_name='InvalidKeyPair.Duplicate', error_response={ | |
| 'Error': { | |
| 'Code': 'Duplicate', | |
| 'Message': 'This is a custom message' | |
| } | |
| } | |
| ) |
To add a value to a secret we need to ensure it is base64 encoded without whitespace
E.g.
echo -n 'true' | base64 -w0
| # example multistage process docker build script from https://blog.phusion.nl/2016/08/31/efficiently-and-conveniently-building-ruby-and-node-js-application-docker-containers-for-production-2 | |
| set -e | |
| export IMAGE_NAME=tinco/express-example | |
| export RUN_BUILD="docker run -it --rm -v $PWD:/usr/src/app -w /usr/src/app node:6" | |
| export TEST_COMMAND="./node_modules/mocha/bin/mocha" | |
| function run_image() { |