Skip to content

Instantly share code, notes, and snippets.

View pgressa's full-sized avatar

Pavol Gressa pgressa

View GitHub Profile
# using symbolic link which are pointing to maven modules with real source code
# pros:
# - maven standard structure
# cons:
# - symbolic link there
<root>
|- resources -> /libs/src/main/resources
|- vars -> /libs/src/main/groovy/vars
|- src -> /libs/src/main/groovy/src
@pgressa
pgressa / gist:5c920510e048916875752d72e7bd5016
Last active July 27, 2020 20:24
Consul watches support for micronaut

Consul watches support for Micronaut Service Discovery

Currently supported watches by Consul [1]:

  • key - Watch a specific KV pair
  • keyprefix - Watch a prefix in the KV store
  • services - Watch the list of available services
  • nodes - Watch the list of nodes
  • service- Watch the instances of a service
  • checks - Watch the value of health checks
  • event - Watch for custom user events
@pgressa
pgressa / gist:e95a9a81f8de8d9fca91515654222208
Last active March 23, 2021 15:59
Micronaut Kubernetes + Dekorate scenario

Intro

In this scenario we will demonstrate the Micronaut Kubernetes Discovery module.

Prerequisites:

  • kubernetes cluster
  • docker
  • java
  • dockerhub account
@pgressa
pgressa / gist:77ee9eb547c625aeec787ee639173b27
Created June 1, 2021 15:17
maven-micronaut-bug-package-deploy
./mvnw clean package deploy -Dpackaging=docker-native -Ddocker.image.suffix=native --no-transfer-progress -Pgraalvm
docker images --digests | grep -v "<none>" | grep carts-native
shell: /usr/bin/bash -e {0}
env:
JAVA: 11
JAVA_HOME: /home/opc/mushop/runner_1/_work/_tool/Java_Adopt_jdk/11.0.11-9/x64
--2021-06-01 10:25:42-- https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
Resolving repo.maven.apache.org (repo.maven.apache.org)... 199.232.152.215
Connecting to repo.maven.apache.org (repo.maven.apache.org)|199.232.152.215|:443... connected.
HTTP request sent, awaiting response... 200 OK
/app/application: /usr/lib/libstdc++.so.6: no version information available (required by /app/application)
__ __ _ _
| \/ (_) ___ _ __ ___ _ __ __ _ _ _| |_
| |\/| | |/ __| '__/ _ \| '_ \ / _` | | | | __|
| | | | | (__| | | (_) | | | | (_| | |_| | |_
|_| |_|_|\___|_| \___/|_| |_|\__,_|\__,_|\__|
Micronaut (v2.5.4)
10:02:13.454 [main] INFO i.m.context.env.DefaultEnvironment - Established active environments: [k8s, cloud, oraclecloud]
10:02:13.466 [main] INFO com.oracle.bmc.Services - Registering new service: Services.BasicService(serviceName=DATABASE, serviceEndpointPrefix=database, serviceEndpointTemplate=https://database.{region}.{secondLevelDomain})
DEBUG i.m.h.s.netty.RoutingInBoundHandler - Request POST /api/cart
18:46:48.749 [default-nioEventLoopGroup-5-15] INFO api.services.support.CartIdBinder - Binding CartID request Host -> [ mushop-api],User-Agent -> [ Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36],Accept -> [ application/json, text/plain, */*],Accept-Encoding -> [ gzip, deflate, br],Accept-Language -> [ cs,sk;q=0.9,en-US;q=0.8,en;q=0.7],Content-Type -> [ application/json;charset=UTF-8],Cookie -> [ SESSION=MTQwYTMzNjktZDFkMC00MTQyLTgwYmEtNTEyMzM4N2ZmNGIz],Origin -> [ https://129.159.103.190],Referer -> [ https://129.159.103.190/],Sec-Ch-Ua -> [ " Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"],Sec-Ch-Ua-Mobile -> [ ?0],Sec-Fetch-Dest -> [ empty],Sec-Fetch-Mode -> [ cors],Sec-Fetch-Site -> [ same-origin],X-Forwarded-For -> [ 10.244.0.0, 10.244.1.4],X-Forwarded-Host -> [ 129.159.103.190],X-Forwarded-Port -> [ 443],X-Forwarded-Proto -> [ https],X-Forwarded-
19:35:11.839 [default-nioEventLoopGroup-5-14] DEBUG i.m.h.s.netty.RoutingInBoundHandler - Request GET /api/config
19:35:11.839 [default-nioEventLoopGroup-5-13] DEBUG i.m.h.s.netty.RoutingInBoundHandler - Request GET /api/profile
19:35:11.839 [default-nioEventLoopGroup-5-14] DEBUG io.lettuce.core.RedisChannelHandler - dispatching command AsyncCommand [type=HGETALL, output=MapOutput [output=AsyncCommand [type=HGETALL, output=MapOutput [output={}, error='null'], commandType=io.lettuce.core.protocol.Command], error='null'], commandType=io.lettuce.core.protocol.Command]
19:35:11.839 [default-nioEventLoopGroup-5-14] DEBUG i.l.core.protocol.DefaultEndpoint - [channel=0xd612b754, /10.244.0.148:45578 -> mushop-session/10.96.79.153:6379, epid=0x2] write() writeAndFlush command AsyncCommand [type=HGETALL, output=MapOutput [output=[channel=0xd612b754, /10.244.0.148:45578 -> mushop-session/10.96.79.153:6379, epid=0x2], error='null'], commandType=io.lettuce.core.protocol.Command]
19:35:11.839 [default-nioEventLoopGroup-5-1
@pgressa
pgressa / rds.yaml
Last active November 18, 2021 21:16
cloudformation for rds and autorotate
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::SecretsManager-2020-07-23
Description: Deploys an RDS instance
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: Basic configuration
Parameters:
- DBName
@pgressa
pgressa / install.sh
Created July 12, 2021 09:15
Install self-hosted runners
#!/usr/bin/env bash
REPOSITORY_URL=$1
TOKEN=$2
RUNNER_ID=1000
RUNNER_DIR_NAME=
for i in {0..1000}; do
RUNNER_DIR_NAME=runner_$i

Cloud Object Storage Abstraction Layer

Q: Shouldn't we name it like Cloud Agnostic Object Storage Interface

The Object Storage is one of the fundamental services provided by the cloud provides. The objects are generally stored in the tree directory structure similary like on the file system. The objects are consumed either by API or in most cases by their unique HTTP URL or by cloud specific internal URI (See Appendix 1).

Motivation

The initiative addresses a growing need to support the hybrid cloud applications by allowing the developers to transparently access and manipulate the objects from within applications running in various cloud environments.