Skip to content

Instantly share code, notes, and snippets.

View dyusupov's full-sized avatar

Dmitry Yusupov dyusupov

View GitHub Profile
var assert = require('assert');
var async = require('async');
var debug = require('debug')('edgex-stream-test');
var http = require('http');
var Agent = require('agentkeepalive');
var keepaliveAgent = new Agent({
maxSockets: 1,
maxFreeSockets: 10,
timeout: 60000,
@dyusupov
dyusupov / multi-network.yaml
Created June 3, 2019 02:02
multi network with contiv and multus
############################################################
#
# Multi-homed pod network configuration:
#
# - contivk8s used for client
# - macvlan used as a backend bridge
#
# Assumptions:
#
# - arch == amd64
@dyusupov
dyusupov / Dockerfile
Last active June 3, 2019 01:57
multus dockerfile
############################################################
# Dockerfile to build Multus init container image
# Based on Ubuntu
############################################################
# Set the base image to Ubuntu to produce amd64 binary
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y wget git
RUN wget -c https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz
RUN tar xzf go1.8.linux-amd64.tar.gz
@dyusupov
dyusupov / gcp-edgefs-s3-delete-sync.js
Created May 29, 2019 18:18
GCP GS and EdgeFS delete synchronization via Cloud function
'use strict';
const AWS = require('aws-sdk');
const Storage = require('@google-cloud/storage');
// ======= config section =======
var GCP_ACCOUNT = "xxxxxxxx@appspot.gserviceaccount.com"; // GCP Service Account Email
var EDGEFS_PROVIDER = "gcs-p12"; // Has to match EdgeFS Cloud Provider name
var EDGEFS_ACCESS = "edgefs_access_key"; // EdgeFS tenant user S3 access key
var EDGEFS_SECRET = "edgefs_secret"; // EdgeFS tenant user S3 secret key
@dyusupov
dyusupov / gcp-edgefs-s3-create-sync.js
Created May 29, 2019 18:16
GCP GS and EdgeFS create synchronization via Cloud function
'use strict';
const AWS = require('aws-sdk');
const Storage = require('@google-cloud/storage');
// ======= config section =======
var GCP_ACCOUNT = "xxxxxxxx@appspot.gserviceaccount.com"; // GCP Service Account Email
var EDGEFS_PROVIDER = "gcs-p12"; // Has to match EdgeFS Cloud Provider name
var EDGEFS_ACCESS = "edgefs_access_key"; // EdgeFS tenant user S3 access key
var EDGEFS_SECRET = "edgefs_secret"; // EdgeFS tenant user S3 secret key
@dyusupov
dyusupov / aws-s3-edgefs-sync.js
Last active May 29, 2019 18:12
AWS S3 and EdgeFS synchronization via Lambda function
var assert = require('assert');
var qs = require('querystring');
var AWS = require('aws-sdk');
var url = require('url');
var dns = require('dns');
// ======= config section =======
var AWS_ACCESS = "aws_key";
var AWS_SECRET = "aws_secret";
var EDGEFS_PROVIDER = "aws-s3"; // Has to match EdgeFS supported Cloud Provider name
version: '2.4'
services:
target:
mem_limit: 1g
memswap_limit: 0
privileged: true
ipc: "host"
restart: always
volumes:
- '/edgefs/var:/opt/nedge/var:z'
@dyusupov
dyusupov / s3-1mb.xml
Created March 3, 2019 06:14
cosbench s3 1MB read-write, single bucket 100,000 objects
<?xml version="1.0" encoding="UTF-8"?>
<workload name="S3-1MB-write-reread" description="Verification of S3 parallel I/O of 1MB objects into a single bucket">
<auth type="none" config="username=admin;password=edgefs;auth_url=http://172.10.10.75:8080/auth/v1.0"/>
<workflow config="">
<workstage name="prepare">
<work name="prepare-objects" type="prepare" workers="40" division="object"
interval="20" config="cprefix=shared;containers=r(1,1);objects=r(1,100000);sizes=r(1,1)MB;hashCheck=false">
<storage type="s3" config="accesskey=KEY;secretkey=SEC;endpoint=http://172.10.10.75:9982;timeout=600000"/>
</work>
</workstage>
@dyusupov
dyusupov / docker-compose.yml
Last active August 10, 2021 05:49
single-node docker-compose file
version: '2.4'
services:
target:
privileged: true
network_mode: "host"
ipc: "host"
restart: always
volumes:
- '/etc/localtime:/etc/localtime:ro'
- '/edgefs/var/run:/opt/nedge/var/run:z'
@dyusupov
dyusupov / edgefs-s3-gateway.yaml
Last active December 15, 2018 02:53
edgefs-s3-gateway.yaml
apiVersion: edgefs.rook.io/v1alpha1
kind: S3
metadata:
name: objects
namespace: rook-edgefs
spec:
instances: 1
placement:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution: