Add http gateway(s)

This commit is contained in:
Vitaliy Potyarkin 2024-09-27 13:51:24 +00:00
parent 6af41ae8ce
commit 7751571e3d
5 changed files with 167 additions and 0 deletions

View file

@ -1,6 +1,7 @@
FROSTFS_VERSION?=0.42.9
FROSTFS_CONTRACTS_VERSION=0.19.4
FROSTFS_LOCODE_VERSION=0.4.0
FROSTFS_HTTPGW_VERSION=0.30.2
NEOGO_VERSION?=0.106.3
NEOGO_RPC_ENDPOINT?=http://$(NEOGO_NODE1_IP):30333
@ -37,6 +38,9 @@ NEOGO_RELEASE_URL=https://github.com/nspcc-dev/neo-go/releases/download/v$(NEOGO
LOCODE?=bin/locode.db
LOCODE_RELEASE_URL=https://git.frostfs.info/TrueCloudLab/frostfs-locode-db/releases/download/v$(FROSTFS_LOCODE_VERSION)/locode_db.gz
HTTP?=bin/frostfs-http-gw-v$(FROSTFS_HTTPGW_VERSION)
HTTP_RELEASE_URL=https://git.frostfs.info/TrueCloudLab/frostfs-http-gw/releases/download/v$(FROSTFS_HTTPGW_VERSION)/frostfs-http-gw
bin/frostfs-adm-v$(FROSTFS_VERSION):
mkdir -p $(dir $@)
wget -q "$(ADM_RELEASE_URL)" -O "$@"
@ -57,6 +61,11 @@ bin/frostfs-ir-v$(FROSTFS_VERSION):
wget -q "$(IR_RELEASE_URL)" -O "$@"
chmod +x "$@"
bin/frostfs-http-gw-v$(FROSTFS_HTTPGW_VERSION):
mkdir -p $(dir $@)
wget -q "$(HTTP_RELEASE_URL)" -O "$@"
chmod +x "$@"
bin/neo-go-v$(NEOGO_VERSION):
mkdir -p $(dir $@)
wget -q "$(NEOGO_RELEASE_URL)" -O "$@"

24
http-gw/Makefile Normal file
View file

@ -0,0 +1,24 @@
include ../Makefile
NODE_COUNT=9
.PHONY: up down down-fast
up: COMPOSE_ARGS=-d
up: network-up
down-fast: COMPOSE_ARGS=--timeout 0
down-fast: down
up down:
error=0; \
for NODE_ID in {1..$(NODE_COUNT)}; do \
GID=$$(id -g); \
export NODE_ID UID GID; \
docker-compose -p "http-gw$$NODE_ID" $@ $(COMPOSE_ARGS) || error=$$?; \
done; \
exit $$error
.PHONY: http-gw
http-gw: wallet | $(HTTP)
mkdir -p log
$(HTTP) --config http-gw.yml 2>&1 | tee --append log/$@$(NODE_ID)
wallet:
ln -sf ../morph/$@ $@

1
http-gw/bin Symbolic link
View file

@ -0,0 +1 @@
../bin

View file

@ -0,0 +1,22 @@
version: '2'
networks:
bringup-network:
name: bringup
external: true
services:
http-gw:
image: golang:latest
hostname: http-gw${NODE_ID:?required variable not defined}
container_name: http-gw${NODE_ID}
networks:
bringup-network:
user: "${UID}:${GID}"
environment:
- NODE_COUNT=$NODE_COUNT
- HOME=/bringup/http-gw/data/home$NODE_ID
volumes:
- ..:/bringup
working_dir: /bringup/http-gw
command: ["make", "http-gw", "NODE_ID=${NODE_ID}"]

111
http-gw/http-gw.yml Normal file
View file

@ -0,0 +1,111 @@
wallet:
path: wallet/subject.json
passphrase: subject
pprof:
enabled: false
address: localhost:8083
prometheus:
enabled: false
address: localhost:8084
tracing:
enabled: false
exporter: "otlp_grpc"
endpoint: "localhost:4317"
trusted_ca: ""
logger:
level: debug
destination: stdout
server:
- address: :80
tls:
enabled: false
peers:
0:
address: grpc://storage1:8802
priority: 1
weight: 1
1:
address: grpc://storage2:8802
priority: 1
weight: 1
2:
address: grpc://storage3:8802
priority: 1
weight: 1
reconnect_interval: 1m
web:
# Per-connection buffer size for requests' reading.
# This also limits the maximum header size.
read_buffer_size: 4096
# Per-connection buffer size for responses' writing.
write_buffer_size: 4096
# ReadTimeout is the amount of time allowed to read
# the full request including body. The connection's read
# deadline is reset when the connection opens, or for
# keep-alive connections after the first byte has been read.
read_timeout: 10m
# WriteTimeout is the maximum duration before timing out
# writes of the response. It is reset after the request handler
# has returned.
write_timeout: 5m
# StreamRequestBody enables request body streaming,
# and calls the handler sooner when given body is
# larger then the current limit.
stream_request_body: true
# Maximum request body size.
# The server rejects requests with bodies exceeding this limit.
max_request_body_size: 4194304
# RPC endpoint to be able to use nns container resolving.
rpc_endpoint: http://morph1:30333
# The order in which resolvers are used to find an container id by name.
resolve_order:
- nns
- dns
upload_header:
use_default_timestamp: false # Create timestamp for object if it isn't provided by header.
connect_timeout: 5s # Timeout to dial node.
stream_timeout: 10s # Timeout for individual operations in streaming RPC.
request_timeout: 5s # Timeout to check node health during rebalance.
rebalance_timer: 30s # Interval to check nodes health.
pool_error_threshold: 100 # The number of errors on connection after which node is considered as unhealthy.
zip:
compression: false # Enable zip compression to download files by common prefix.
runtime:
soft_memory_limit: 1gb
# Parameters of requests to FrostFS
frostfs:
# This flag enables client side object preparing.
client_cut: false
# Sets max buffer size for read payload in put operations.
buffer_max_size_for_put: 1048576
# Max attempt to make successful tree request.
# default value is 0 that means the number of attempts equals to number of nodes in pool.
tree_pool_max_attempts: 0
# Caching
cache:
# Cache which contains mapping of bucket name to bucket info
buckets:
lifetime: 1m
size: 1000
resolve_bucket:
namespace_header: X-Frostfs-Namespace
default_namespaces: [ "", "root" ]