From 8ae5c96987e80428a86748187c0049166e7ea43e Mon Sep 17 00:00:00 2001 From: bschatz-swift Date: Tue, 26 Jan 2021 21:12:05 -0800 Subject: [PATCH 001/160] Adding TLS support to proxyfsd (#572) * Add etcdclient pkg to make calls to etcd. Also add TLS * Use same path as kubepsray * Pass tlsconfig to etcdclient.New() --- etcdclient/Makefile | 3 +++ etcdclient/api.go | 57 ++++++++++++++++++++++++++++++++++++++++++++ headhunter/config.go | 15 ++++++++---- mkproxyfs/api.go | 16 ++++++++----- pfs-fsck/main.go | 15 ++++++++---- 5 files changed, 90 insertions(+), 16 deletions(-) create mode 100644 etcdclient/Makefile create mode 100644 etcdclient/api.go diff --git a/etcdclient/Makefile b/etcdclient/Makefile new file mode 100644 index 000000000..ca85948cb --- /dev/null +++ b/etcdclient/Makefile @@ -0,0 +1,3 @@ +gosubdir := github.com/swiftstack/ProxyFS/etcdclient + +include ../GoMakefile diff --git a/etcdclient/api.go b/etcdclient/api.go new file mode 100644 index 000000000..cc834efe6 --- /dev/null +++ b/etcdclient/api.go @@ -0,0 +1,57 @@ +package etcdclient + +import ( + "log" + "os" + "time" + + etcd "go.etcd.io/etcd/clientv3" + "go.etcd.io/etcd/pkg/transport" +) + +const ( + certPath = "/etc/ssl/etcd/ssl/" + trustedCAFile = certPath + "ca.pem" +) + +// New initializes etcd config structures and returns an etcd client +func New(tlsInfo *transport.TLSInfo, endPoints []string, autoSyncInterval time.Duration, dialTimeout time.Duration) (etcdClient *etcd.Client, err error) { + tlsConfig, etcdErr := tlsInfo.ClientConfig() + if etcdErr != nil { + log.Fatal(etcdErr) + } + + etcdClient, err = etcd.New(etcd.Config{ + Endpoints: endPoints, + AutoSyncInterval: autoSyncInterval, + DialTimeout: dialTimeout, + TLS: tlsConfig, + }) + return +} + +// GetCertFile returns the name of the cert file for the local node +func GetCertFile() string { + h, _ := os.Hostname() + return certPath + "node-" + h + ".pem" +} + +// GetKeyFile returns the name of the key file for the local node +func GetKeyFile() string { + h, _ := os.Hostname() + return certPath + "node-" + h + "-key.pem" +} + +// GetCA returns the name of the certificate authority for the local node +func GetCA() string { + var ( + caFile string + ) + + _, statErr := os.Stat(trustedCAFile) + if os.IsExist(statErr) { + caFile = trustedCAFile + } + + return caFile +} diff --git a/headhunter/config.go b/headhunter/config.go index dc6d22bd4..63c86c0be 100644 --- a/headhunter/config.go +++ b/headhunter/config.go @@ -12,12 +12,14 @@ import ( "time" etcd "go.etcd.io/etcd/clientv3" + "go.etcd.io/etcd/pkg/transport" "github.com/swiftstack/cstruct" "github.com/swiftstack/sortedmap" "github.com/swiftstack/ProxyFS/bucketstats" "github.com/swiftstack/ProxyFS/conf" + "github.com/swiftstack/ProxyFS/etcdclient" "github.com/swiftstack/ProxyFS/logger" "github.com/swiftstack/ProxyFS/swiftclient" "github.com/swiftstack/ProxyFS/trackedlock" @@ -469,11 +471,14 @@ func (dummy *globalsStruct) Up(confMap conf.ConfMap) (err error) { // Initialize etcd Client & KV objects - globals.etcdClient, err = etcd.New(etcd.Config{ - Endpoints: globals.etcdEndpoints, - AutoSyncInterval: globals.etcdAutoSyncInterval, - DialTimeout: globals.etcdDialTimeout, - }) + tlsInfo := transport.TLSInfo{ + CertFile: etcdclient.GetCertFile(), + KeyFile: etcdclient.GetKeyFile(), + TrustedCAFile: etcdclient.GetCA(), + } + + globals.etcdClient, err = etcdclient.New(&tlsInfo, globals.etcdEndpoints, + globals.etcdAutoSyncInterval, globals.etcdDialTimeout) if nil != err { return } diff --git a/mkproxyfs/api.go b/mkproxyfs/api.go index 31b4b1a86..68842bacd 100644 --- a/mkproxyfs/api.go +++ b/mkproxyfs/api.go @@ -12,9 +12,11 @@ import ( "time" etcd "go.etcd.io/etcd/clientv3" + "go.etcd.io/etcd/pkg/transport" "github.com/swiftstack/ProxyFS/blunder" "github.com/swiftstack/ProxyFS/conf" + "github.com/swiftstack/ProxyFS/etcdclient" "github.com/swiftstack/ProxyFS/headhunter" "github.com/swiftstack/ProxyFS/logger" "github.com/swiftstack/ProxyFS/swiftclient" @@ -131,13 +133,15 @@ func Format(mode Mode, volumeNameToFormat string, confFile string, confStrings [ return } - // Initialize etcd Client & KV objects + tlsInfo := transport.TLSInfo{ + CertFile: etcdclient.GetCertFile(), + KeyFile: etcdclient.GetKeyFile(), + TrustedCAFile: etcdclient.GetCA(), + } - etcdClient, err = etcd.New(etcd.Config{ - Endpoints: etcdEndpoints, - AutoSyncInterval: etcdAutoSyncInterval, - DialTimeout: etcdDialTimeout, - }) + // Initialize etcd Client & KV objects + etcdClient, err = etcdclient.New(&tlsInfo, etcdEndpoints, + etcdAutoSyncInterval, etcdDialTimeout) if nil != err { return } diff --git a/pfs-fsck/main.go b/pfs-fsck/main.go index 1eecbb9e8..d2b6be1b3 100644 --- a/pfs-fsck/main.go +++ b/pfs-fsck/main.go @@ -17,11 +17,13 @@ import ( "time" etcd "go.etcd.io/etcd/clientv3" + "go.etcd.io/etcd/pkg/transport" "github.com/swiftstack/cstruct" "github.com/swiftstack/sortedmap" "github.com/swiftstack/ProxyFS/conf" + "github.com/swiftstack/ProxyFS/etcdclient" "github.com/swiftstack/ProxyFS/headhunter" ) @@ -376,11 +378,14 @@ func setup() { log.Fatal(err) } - globals.etcdClient, err = etcd.New(etcd.Config{ - Endpoints: globals.etcdEndpoints, - AutoSyncInterval: globals.etcdAutoSyncInterval, - DialTimeout: globals.etcdDialTimeout, - }) + tlsInfo := transport.TLSInfo{ + CertFile: etcdclient.GetCertFile(), + KeyFile: etcdclient.GetKeyFile(), + TrustedCAFile: etcdclient.GetCA(), + } + + globals.etcdClient, err = etcdclient.New(&tlsInfo, globals.etcdEndpoints, + globals.etcdAutoSyncInterval, globals.etcdDialTimeout) if nil != err { log.Fatalf("unable to create etcdClient: %v\n", err) } From 8298d4a45718654028939abb0509ce044df65256 Mon Sep 17 00:00:00 2001 From: bschatz-swift Date: Tue, 26 Jan 2021 21:47:31 -0800 Subject: [PATCH 002/160] Add missing copyright files (#573) * Add missing copyright files * Build etcdclient --- Makefile | 1 + etcdclient/Makefile | 3 +++ etcdclient/api.go | 3 +++ 3 files changed, 7 insertions(+) diff --git a/Makefile b/Makefile index d0722cf20..9412bb060 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ gopkgsubdirs = \ conf \ confgen \ dlm \ + etcdclient \ evtlog \ fs \ fuse \ diff --git a/etcdclient/Makefile b/etcdclient/Makefile index ca85948cb..41aba670b 100644 --- a/etcdclient/Makefile +++ b/etcdclient/Makefile @@ -1,3 +1,6 @@ +# Copyright (c) 2015-2021, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 + gosubdir := github.com/swiftstack/ProxyFS/etcdclient include ../GoMakefile diff --git a/etcdclient/api.go b/etcdclient/api.go index cc834efe6..528c8efb2 100644 --- a/etcdclient/api.go +++ b/etcdclient/api.go @@ -1,3 +1,6 @@ +// Copyright (c) 2015-2021, NVIDIA CORPORATION. +// SPDX-License-Identifier: Apache-2.0 + package etcdclient import ( From 2cb6ea33bb91fe314e95bba2f39887ff5936a636 Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Fri, 22 Jan 2021 09:59:45 -0800 Subject: [PATCH 003/160] Removed jrpcclient & vfs submodules --- .gitmodules | 8 -------- jrpcclient | 1 - vfs | 1 - 3 files changed, 10 deletions(-) delete mode 100644 .gitmodules delete mode 160000 jrpcclient delete mode 160000 vfs diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index b9caa4ce5..000000000 --- a/.gitmodules +++ /dev/null @@ -1,8 +0,0 @@ -[submodule "proxyfs-jrpc-client"] - path = jrpcclient - url = git@github.com:swiftstack/proxyfs-jrpc-client.git - branch = master -[submodule "proxyfs-vfs"] - path = vfs - url = git@github.com:swiftstack/proxyfs-vfs.git - branch = master diff --git a/jrpcclient b/jrpcclient deleted file mode 160000 index 7ce4e2d66..000000000 --- a/jrpcclient +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7ce4e2d66252ac880df63c78cd7d95894dc9df7f diff --git a/vfs b/vfs deleted file mode 160000 index 768b89e6e..000000000 --- a/vfs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 768b89e6e67666020efd0689fd4ee2fb94e93488 From 2403e448276ca4549b7e13b3515e1d7b396e0473 Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Fri, 22 Jan 2021 10:50:00 -0800 Subject: [PATCH 004/160] Updates following submodule deprecation --- DEBUG.md | 3 - Makefile | 39 +----- README.md | 8 +- regression_test.py | 304 --------------------------------------------- 4 files changed, 6 insertions(+), 348 deletions(-) delete mode 100755 regression_test.py diff --git a/DEBUG.md b/DEBUG.md index 860a071ee..05819f0c0 100644 --- a/DEBUG.md +++ b/DEBUG.md @@ -3,7 +3,6 @@ ## Logging Logs from proxyfsd are output to `proxyfsd.log`. - ## Kill with trace data Find the daemon's pid: `ps -eaf | grep proxyfsd` @@ -14,9 +13,7 @@ Find the daemon's pid: `ps -eaf | grep proxyfsd` Tell gdb to attach to that pid: `gdb -p ` - ## Generating a core file If you want to generate a core file from within gdb: `(gdb) gcore` If you want to generate a core file without using gdb: `gcore ` - diff --git a/Makefile b/Makefile index 9412bb060..3fad56c34 100644 --- a/Makefile +++ b/Makefile @@ -81,13 +81,13 @@ ifeq ($(uname),Linux) else distro := $(shell python -c "import platform; print platform.linux_distribution()[0]") - all: version fmt pre-generate generate install test python-test c-clean c-build c-install c-test + all: version fmt pre-generate generate install test python-test - ci: version fmt pre-generate generate install test cover python-test c-clean c-build c-install c-test + ci: version fmt pre-generate generate install test cover python-test - all-deb-builder: version fmt pre-generate generate install c-clean c-build c-install-deb-builder + all-deb-builder: version fmt pre-generate generate install - minimal: pre-generate generate install c-clean c-build c-install + minimal: pre-generate generate install endif else all: version fmt pre-generate generate install test @@ -99,7 +99,7 @@ endif pfsagent: pre-generate generate pfsagent-install -.PHONY: all all-deb-builder bench c-build c-clean c-install c-install-deb-builder c-test ci clean cover fmt generate install pfsagent pfsagent-install pre-generate python-test test version +.PHONY: all all-deb-builder bench ci clean cover fmt generate install pfsagent pfsagent-install pre-generate python-test test version bench: @set -e; \ @@ -110,35 +110,6 @@ bench: $(MAKE) --no-print-directory -C $$gosubdir bench; \ done -c-build: - $(MAKE) -w -C jrpcclient all - $(MAKE) -w -C vfs - -c-clean: - $(MAKE) -w -C jrpcclient clean - $(MAKE) -w -C vfs clean - -c-install: -ifeq ($(distro),CentOS Linux) - sudo -E $(MAKE) -w -C jrpcclient installcentos - sudo -E $(MAKE) -w -C vfs installcentos -else - sudo -E $(MAKE) -w -C jrpcclient install - sudo -E $(MAKE) -w -C vfs install -endif - -c-install-deb-builder: -ifeq ($(distro),CentOS Linux) - $(MAKE) -w -C jrpcclient installcentos - $(MAKE) -w -C vfs installcentos -else - $(MAKE) -w -C jrpcclient install - $(MAKE) -w -C vfs install -endif - -c-test: - cd jrpcclient ; ./regression_test.py --just-test-libs - clean: @set -e; \ rm -f $(GOPATH)/bin/stringer; \ diff --git a/README.md b/README.md index 5aef2dfa7..3ee4da5dc 100644 --- a/README.md +++ b/README.md @@ -48,19 +48,13 @@ one. * cd src/github.com/swiftstack * git clone git@github.com:swiftstack/ProxyFS.git * cd ProxyFS -* git submodule update --init --recursive ## How to run unit tests (in your Development Environment) * Install/update to at least Go 1.8.3 (if not using Runway) * Ensure $GOPATH/bin is in your $PATH * cd $GOPATH/src/github.com/swiftstack/ProxyFS -* ./regression_test.py - -## Commercial Deployment - -ProxyFS powers File Access for the SwiftStack product. -See: http://swiftstack.com +* make ## License diff --git a/regression_test.py b/regression_test.py deleted file mode 100755 index 06bde89bc..000000000 --- a/regression_test.py +++ /dev/null @@ -1,304 +0,0 @@ -#!/usr/bin/env python - -# Copyright (c) 2015-2021, NVIDIA CORPORATION. -# SPDX-License-Identifier: Apache-2.0 - -""" -A script to lint and test ProxyFS project code. -""" - -from __future__ import print_function, unicode_literals -from threading import Timer - -import os -import argparse -import functools -import logging -import platform -import contextlib -import subprocess -import shutil -import sys -import tempfile -import time - - -PACKAGES = ["blunder", - "cleanproxyfs", - "conf", - "dlm", - "fs", - "fsworkout", - "fuse", - "headhunter", - "httpserver", - "inode", - "inodeworkout", - "jrpcfs", - "logger", - "mkproxyfs", "mkproxyfs/mkproxyfs", - "pfs-stress", - "pfsconfjson", "pfsconfjsonpacked", - "pfsworkout", - "platform", - "proxyfsd", "proxyfsd/proxyfsd", - "ramswift", "ramswift/ramswift", - "stats", - "statslogger", - "swiftclient", - "utils"] - - -COLORS = {"bright red": '1;31', "bright green": '1;32'} - - -@contextlib.contextmanager -def return_to_wd(): - curdir = os.getcwd() - try: - yield - finally: - os.chdir(curdir) - - -@contextlib.contextmanager -def self_cleaning_tempdir(*args, **kwargs): - our_tempdir = tempfile.mkdtemp(*args, **kwargs) - try: - yield our_tempdir - finally: - shutil.rmtree(our_tempdir, ignore_errors=True) - - -def proxyfs_binary_path(binary): - try: - gopath = os.environ["GOPATH"] - except KeyError: - color_print("$GOPATH must be set", 'bright red') - os.exit(1) - return os.path.join(gopath, "bin", binary) - - -def color_print(content, color=None): - print("\x1b[{color}m{content}\x1b[0m".format(content=content, - color=COLORS[color])) - - -def proxyfs_package_path(package): - try: - gopath = os.environ["GOPATH"] - except KeyError: - color_print("$GOPATH must be set", 'bright red') - os.exit(1) - return os.path.join(gopath, "src/github.com/swiftstack/ProxyFS", package) - - -def color_print(content, color=None): - print("\x1b[{color}m{content}\x1b[0m".format(content=content, - color=COLORS[color])) - - -def report(task, success=False): - printer = color_print if sys.stdout.isatty() else lambda *a, **kw: print(*a) - if success: - printer("{} {}".format(task, "succeeded!"), color="bright green") - else: - printer("{} {}".format(task, "failed!"), color="bright red") - - -class GoCommand(object): - def __init__(self, command, project_path, - options=None, report_as=None, skip=False): - self.command = command - self.project_path = project_path - self.options = options or [] - self.report_as = report_as - self.skip = skip - - def execute(self, package): - if self.skip: - return None - package_path = "{}{}".format(self.project_path, package) - command_line = ["go", self.command] + self.options + [package_path] - logging.info(' '.join("'{}'".format(s) if ' ' in s else s - for s in command_line)) - success = not bool(subprocess.call(command_line)) - return success - - -def get_go_commands(options, project_path, skip_tests=False): - commands = [ - GoCommand('fmt', project_path), - GoCommand('get', project_path, ['-t', '-u'], skip=not options.get), - # Source code has to be `go install`ed before `stringer` can run on - # it, so we install before generate, which mysteriously does work? - # see https://github.com/golang/go/issues/10249 - GoCommand('install', project_path, ['-gcflags', '-N -l'], report_as="`go install`"), - GoCommand('generate', project_path, report_as="`go generate`"), - ] - if not options.deb_builder: - commands.append( - GoCommand('test', project_path, - filter(lambda x: x, [options.bench, options.cover]), - report_as="`go test`", - skip=skip_tests) - ) - commands.append(GoCommand('vet', project_path, report_as="`go vet`")) - return commands - - -def execute_go_commands(commands, packages): - reports = [] - failures = 0 - for command in commands: - successes = filter(lambda success: success is not None, - [command.execute(package) for package in packages]) - success = all(successes) - failures += not success - if command.report_as is not None: - reports.append(functools.partial(report, command.report_as, - success=success)) - for reporter in reports: - reporter() - return failures - - -def test_pfs_middleware(options): - failures = 0 - with return_to_wd(): - proxyfs_dir = os.path.dirname(os.path.abspath(__file__)) - pfs_middleware_dir = os.path.join(proxyfs_dir, "pfs_middleware") - os.chdir(pfs_middleware_dir) - failures += bool(subprocess.call((['python', 'setup.py', 'test']))) - report("test_pfs_middleware()", not failures) - return failures - - -def build_proxyfs(options): - commands = get_go_commands(options, "github.com/swiftstack/ProxyFS/") - if options.packages is None: - selected_packages = PACKAGES - else: - selected_packages = options.packages - return execute_go_commands(commands, selected_packages) - - -def build_dependencies(options): - failures = 0 - proxyfs_dir = os.path.dirname(os.path.abspath(__file__)) - stringer_path = 'golang.org/x/tools/cmd/stringer' - full_stringer_path = os.path.join(proxyfs_dir, "vendor", stringer_path) - print("Building " + stringer_path) - install_cmd = ("go", "install") - with return_to_wd(): - os.chdir(full_stringer_path) - success = not(bool(subprocess.call(install_cmd))) - failures += not success - report("build_dependencies()", not failures) - return failures - - -def build_jrpcclient(options): - proxyfs_dir = os.path.dirname(os.path.abspath(__file__)) - jrpcclient_dir = os.path.join(proxyfs_dir, "jrpcclient") - command = ['./regression_test.py'] - if options.no_install: - command.append('--no-install') - if options.deb_builder: - command.append('--deb-builder') - if options.just_build_libs: - command.append('--just-build-libs') - return bool(subprocess.call(command, cwd=jrpcclient_dir)) - - -def build_vfs(options): - proxyfs_dir = os.path.dirname(os.path.abspath(__file__)) - vfs_dir = os.path.join(proxyfs_dir, "vfs") - failures = 0 - clean_cmd = ('make', 'clean') - failures += bool(subprocess.call(clean_cmd, cwd=vfs_dir)) - if failures: - return failures - failures += bool(subprocess.call('make', cwd=vfs_dir)) - if failures: - return failures - distro = platform.linux_distribution()[0] - if not options.no_install: - if options.deb_builder: - if 'centos' in distro.lower(): - install_cmd = ('make', 'installcentos') - else: - install_cmd = ('make', 'install') - else: - if 'centos' in distro.lower(): - install_cmd = ('sudo', '-E', 'make', 'installcentos') - else: - install_cmd = ('sudo', '-E', 'make', 'install') - failures += bool(subprocess.call(install_cmd, cwd=vfs_dir)) - return failures - - -def main(options): - failures = 0 - - if not options.just_libs and not options.just_build_libs: - - go_version = subprocess.check_output((['go', 'version'])) - color_print(go_version[:-1], "bright green") - - if not options.quiet: - logging.basicConfig(format="%(message)s", level=logging.INFO) - - failures += build_dependencies(options) - if failures: - return failures - - failures += build_proxyfs(options) - if failures: - return failures - - if platform.system() != "Darwin": - - if not options.no_libs: - - failures += build_jrpcclient(options) - if failures: - return failures - - failures += build_vfs(options) - if failures: - return failures - - return failures - - -if __name__ == "__main__": - arg_parser = argparse.ArgumentParser(description=__doc__) - arg_parser.add_argument('--bench', '-bench', - action='store_const', const='-bench=.', - help="include benchmark measurements in test output") - arg_parser.add_argument('--cover', '-cover', - action='store_const', const='-cover', - help="include coverage statistics in test output") - arg_parser.add_argument('--get', '-get', action='store_true', - help="invoke `go get` to retrieve new dependencies") - arg_parser.add_argument('--packages', '-p', action='store', nargs='*', - help="specific packages to process") - arg_parser.add_argument('--no-install', action='store_true', - help="When building C libraries, do not attempt " - "to install resulting objects") - arg_parser.add_argument('--deb-builder', action='store_true', - help="Modify commands to run inside " - "swift-deb-builder") - arg_parser.add_argument('--quiet', '-q', action='store_true', - help="suppress printing of what commands are being run") - libs_group = arg_parser.add_mutually_exclusive_group() - libs_group.add_argument('--no-libs', action='store_true', - help="don't build C libraries or run C tests") - libs_group.add_argument('--just-build-libs', action='store_true', - help="only build C libraries") - libs_group.add_argument('--just-libs', action='store_true', - help="only build C libraries and run C tests") - options = arg_parser.parse_args() - - exit(main(options)) From 43f0e7dc4025a75221d7796f6fa13412063c3b29 Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Fri, 22 Jan 2021 11:38:55 -0800 Subject: [PATCH 005/160] Removed references to Samba --- saio/bin/provision_samba_source | 62 ------- saio/bin/start_and_mount_pfs | 290 -------------------------------- saio/vagrant_provision.sh | 150 +---------------- sait/vagrant_provision.sh | 54 +----- 4 files changed, 2 insertions(+), 554 deletions(-) delete mode 100755 saio/bin/provision_samba_source delete mode 100755 saio/bin/start_and_mount_pfs diff --git a/saio/bin/provision_samba_source b/saio/bin/provision_samba_source deleted file mode 100755 index fef07fafe..000000000 --- a/saio/bin/provision_samba_source +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2015-2021, NVIDIA CORPORATION. -# SPDX-License-Identifier: Apache-2.0 - -# Setup Samba Source - -cd /vagrant/src/github.com/swiftstack/ProxyFS/vfs -if [[ -d samba4-6-centos ]] -then - if [[ -L samba4-6-centos ]] - then - echo "non-directory symlink \$GOPATH/src/github.com/swiftstack/ProxyFS/vfs/samba4-6-centos cannot pre-exist" - exit 1 - else - echo "\$GOPATH/src/github.com/swiftstack/ProxyFS/vfs/samba4-6-centos assumed to be as desired" - fi -else - if [[ -L samba4-6-centos ]] - then - echo "non-directory symlink \$GOPATH/src/github.com/swiftstack/ProxyFS/vfs/samba4-6-centos cannot pre-exist" - exit 1 - else - git clone -b v4-6-stable --single-branch --depth 1 https://github.com/samba-team/samba.git samba4-6-centos - fi -fi -if [[ -L samba ]] -then - samba_symlink_target=`readlink "samba"` - if [[ "samba4-6-centos" == "$samba_symlink_target" ]] - then - echo "symlink samba -> samba4-6-centos already" - else - echo "redirecting samba -> samba4-6-centos" - rm samba - ln -s samba4-6-centos samba - fi -else - if [[ -e samba ]] - then - echo "non-symlink \$GOPATH/src/github.com/swiftstack/ProxyFS/vfs/samba cannot pre-exist" - exit 1 - else - echo "establishing samba -> samba4-6-centos" - ln -s samba4-6-centos samba - fi -fi -cd samba -if [[ -d bin ]] -then - echo "./configure has already been run" -else - ./configure - make clean -fi -if [[ -f bin/default/librpc/gen_ndr/ndr_smb_acl.h ]] -then - echo "make GEN_NDR_TABLES has already been run" -else - make clean - make GEN_NDR_TABLES -fi diff --git a/saio/bin/start_and_mount_pfs b/saio/bin/start_and_mount_pfs deleted file mode 100755 index e14eb097e..000000000 --- a/saio/bin/start_and_mount_pfs +++ /dev/null @@ -1,290 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2015-2021, NVIDIA CORPORATION. -# SPDX-License-Identifier: Apache-2.0 - -# A simple script to start the services and mount the sample mount point -# The PATH, etc should already be setup by systemctl environment - -function await_proxyfsd_startup { - /usr/bin/systemctl -q is-active proxyfsd - if [ $? -ne 0 ]; then - echo "ProxyFS failed to start. Exiting..." - exit 1 - fi - while true; do - curl http://127.0.0.1:15346/ 2>/dev/null >/dev/null - if [ $? -eq 0 ]; then - break - fi - echo "Waiting for ProxyFS to be started..." - sleep 1 - done -} - -function await_pfsagentd_startup { - /usr/bin/systemctl -q is-active pfsagentd - if [ $? -ne 0 ]; then - echo "PFSAgent failed to start. Exiting..." - exit 1 - fi - while true; do - curl http://127.0.0.1:9090/version 2>/dev/null >/dev/null - if [ $? -eq 0 ]; then - # Service is active and curl to the HTTP server succeeded. - # We're go to go. - break - fi - echo "Waiting for PFSAgent to be started..." - sleep 1 - done -} - -function await_swift_startup { - while true - do - curl http://127.0.0.1:8090/info 2>/dev/null >/dev/null - if [ $? -eq 0 ] - then - break - fi - echo "Waiting for Swift to be started..." - sleep 1 - done -} - -function format_volume_if_necessary { - sudo /vagrant/bin/mkproxyfs -I $1 /vagrant/src/github.com/swiftstack/ProxyFS/saio/proxyfs.conf SwiftClient.RetryLimit=1 - if [ $? -ne 0 ] - then - echo "Could not pre-format $1" - exit 1 - fi -} - -function containsElement () { - local e match="$1" - shift - for e; do [[ "$e" == "$match" ]] && return 0; done - return 1 -} - -help() { - echo "Usage: $0 [mount type]" - echo "Mount type options:" - echo " all: NFS v3 and SMB v3.0 (default option)" - echo " keepmounts: don't umount/mount any mountpoints" - echo " nfs: NFS v3" - echo " smb: SMB v3.0" - echo " smb1: SMB v1.0" - echo " smb2: SMB v2.1" - echo " smb3: SMB v3.0" - echo " pfsa: PFSAgent" -} - -MOUNT_OPTIONS=() -if [ $# -gt 0 ]; then - while [[ $# -gt 0 ]]; do - key="$1" - case $key in - -h|--help) - help - exit 0 - ;; - all|keepmounts|smb|smb1|smb2|smb3|nfs|pfsa) - if containsElement "$key" "${MOUNT_OPTIONS[@]}"; then - echo "Error: duplicated option '${key}'." - echo - help - exit 1 - fi - MOUNT_OPTIONS+=("$1") - shift - ;; - *) - echo "Invalid argument '$key'." - echo - help - exit 1 - esac - done - - # Now that we allow more than one mount option to be passed, we have to check - # for incompatible options. - if [ ${#MOUNT_OPTIONS[@]} -gt 1 ] && containsElement "all" "${MOUNT_OPTIONS[@]}"; then - echo "Error: no other options are allowed while using 'all'." - echo - help - exit 1 - fi - - if [ ${#MOUNT_OPTIONS[@]} -gt 1 ] && containsElement "keepmounts" "${MOUNT_OPTIONS[@]}"; then - echo "Error: no other options are allowed while using 'keepmounts'." - echo - help - exit 1 - fi - - # I know the next 4 'if' clauses are gross, but I don't have the patience to - # find out the proper way to do it in bash. - if [ ${#MOUNT_OPTIONS[@]} -gt 1 ] && containsElement "smb" "${MOUNT_OPTIONS[@]}"; then - if containsElement "smb1" "${MOUNT_OPTIONS[@]}" || containsElement "smb2" "${MOUNT_OPTIONS[@]}" || containsElement "smb3" "${MOUNT_OPTIONS[@]}"; then - echo "Error: only one SMB option can be specified at a time." - echo - help - exit 1 - fi - fi - - if [ ${#MOUNT_OPTIONS[@]} -gt 1 ] && containsElement "smb1" "${MOUNT_OPTIONS[@]}"; then - if containsElement "smb" "${MOUNT_OPTIONS[@]}" || containsElement "smb2" "${MOUNT_OPTIONS[@]}" || containsElement "smb3" "${MOUNT_OPTIONS[@]}"; then - echo "Error: only one SMB option can be specified at a time." - echo - help - exit 1 - fi - fi - - if [ ${#MOUNT_OPTIONS[@]} -gt 1 ] && containsElement "smb2" "${MOUNT_OPTIONS[@]}"; then - if containsElement "smb1" "${MOUNT_OPTIONS[@]}" || containsElement "smb" "${MOUNT_OPTIONS[@]}" || containsElement "smb3" "${MOUNT_OPTIONS[@]}"; then - echo "Error: only one SMB option can be specified at a time." - echo - help - exit 1 - fi - fi - - if [ ${#MOUNT_OPTIONS[@]} -gt 1 ] && containsElement "smb3" "${MOUNT_OPTIONS[@]}"; then - if containsElement "smb1" "${MOUNT_OPTIONS[@]}" || containsElement "smb2" "${MOUNT_OPTIONS[@]}" || containsElement "smb" "${MOUNT_OPTIONS[@]}"; then - echo "Error: only one SMB option can be specified at a time." - echo - help - exit 1 - fi - fi -else - MOUNT_OPTIONS+=("all") -fi - -if containsElement "all" "${MOUNT_OPTIONS[@]}"; then - NFS_VERS=3 - SMB_VERS=3.0 -else - if containsElement "nfs" "${MOUNT_OPTIONS[@]}"; then - NFS_VERS=3 - fi - - if containsElement "smb1" "${MOUNT_OPTIONS[@]}"; then - SMB_VERS=1.0 - elif containsElement "smb2" "${MOUNT_OPTIONS[@]}"; then - SMB_VERS=2.1 - elif containsElement "smb" "${MOUNT_OPTIONS[@]}" || containsElement "smb3" "${MOUNT_OPTIONS[@]}"; then - SMB_VERS=3.0 - fi -fi - -MOUNT_POINT_NFS=127.0.0.1:/CommonMountPoint -SHARE_NFS=/mnt/nfs_proxyfs_mount/ - -MOUNT_POINT_SMB=//127.0.0.1/proxyfs -SHARE_SMB=/mnt/smb_proxyfs_mount/ - -UID_SMB=`id -u` -GID_SMB=`id -g` - -sudo mount -a - -# "keepmounts" means "keep everything as it was", but PFSAgent works differently, -# so just preserving the mount points is not enough. What we'll do is check if -# it's running before trying to stop it, and if it is, save it as a "MOUNT_OPTION" -if [ -f /usr/bin/systemctl ] && containsElement "keepmounts" "${MOUNT_OPTIONS[@]}"; then - /usr/bin/systemctl is-active --quiet pfsagentd && MOUNT_OPTIONS+=("pfsa") -fi - -if containsElement "keepmounts" "${MOUNT_OPTIONS[@]}"; then - echo "Shutting down services..." - /vagrant/src/github.com/swiftstack/ProxyFS/saio/bin/unmount_and_stop_pfs keepmounts -else - echo "Shutting down services and mount points..." - /vagrant/src/github.com/swiftstack/ProxyFS/saio/bin/unmount_and_stop_pfs -fi -echo - -echo "Bringing up services..." -if [ -f /usr/bin/systemctl ]; then - # Centos - MOUNT=/usr/bin/mount - sudo /usr/bin/systemctl start memcached - sudo /usr/bin/swift-init main start - await_swift_startup - format_volume_if_necessary CommonVolume - sudo /usr/bin/systemctl start proxyfsd - await_proxyfsd_startup - echo "ProxyFS successfully started" - sudo /usr/bin/systemctl start smb - sudo /usr/bin/systemctl start rpcbind - sudo /usr/bin/systemctl start nfs-server - sudo /usr/bin/systemctl start nfs-lock - sudo /usr/bin/systemctl start nfs-idmap - if containsElement "all" "${MOUNT_OPTIONS[@]}" || containsElement "pfsa" "${MOUNT_OPTIONS[@]}"; then - echo "Starting PFSAgent..." - sudo /usr/bin/systemctl start pfsagentd - await_pfsagentd_startup - fi -else - # Ubuntu (not tested!) - MOUNT=/bin/mount - sudo /usr/sbin/service memcached start - sudo /usr/bin/swift-init main start - await_swift_startup - format_volume_if_necessary CommonVolume - sudo /usr/sbin/service proxyfsd start - await_proxyfsd_startup - echo "ProxyFS successfully started" - sudo /usr/sbin/service smbd start - sudo /usr/sbin/service rpcbind start - sudo /usr/sbin/service nfs-server start - sudo /usr/sbin/service nfs-lock start - sudo /usr/sbin/service nfs-idmap start - # Here we should start pfsagentd (if 'all' or 'pfsa' are present in - # $MOUNT_OPTIONS), but we don't support Ubuntu -fi -echo - -if containsElement "all" "${MOUNT_OPTIONS[@]}" || containsElement "nfs" "${MOUNT_OPTIONS[@]}"; then - mountpoint -q $SHARE_NFS - if [ $? -ne 0 ]; then - for i in $(seq 5); do - sleep 5 - sudo $MOUNT -t nfs -o vers=$NFS_VERS $MOUNT_POINT_NFS $SHARE_NFS && break - echo "Mount of $SHARE_NFS failed. Retrying..." - done - fi - - mountpoint -q $SHARE_NFS - if [ $? -ne 0 ]; then - echo "ERROR: Could not mount $SHARE_NFS." - exit 1 - else - echo "$SHARE_NFS successfully mounted" - fi -fi - -if containsElement "all" "${MOUNT_OPTIONS[@]}" || containsElement "smb" "${MOUNT_OPTIONS[@]}" || containsElement "smb1" "${MOUNT_OPTIONS[@]}" || containsElement "smb2" "${MOUNT_OPTIONS[@]}" || containsElement "smb3" "${MOUNT_OPTIONS[@]}"; then - mountpoint -q $SHARE_SMB - if [ $? -ne 0 ]; then - for i in $(seq 5); do - sleep 5 - sudo $MOUNT -t cifs -o user=swift,password=swift,uid=$UID_SMB,gid=$GID_SMB,vers=$SMB_VERS,iocharset=utf8,actimeo=0 $MOUNT_POINT_SMB $SHARE_SMB && break - echo "Mount of $SHARE_SMB failed. Retrying..." - done - fi - - mountpoint -q $SHARE_SMB - if [ $? -ne 0 ]; then - echo "ERROR: Could not mount $SHARE_SMB." - exit 1 - else - echo "$SHARE_SMB successfully mounted" - fi -fi diff --git a/saio/vagrant_provision.sh b/saio/vagrant_provision.sh index a97c429c2..76b672ccc 100644 --- a/saio/vagrant_provision.sh +++ b/saio/vagrant_provision.sh @@ -117,77 +117,6 @@ echo "alias goclean=\"go clean;go clean --cache;go clean --testcache\"" >> ~vagr echo "alias gogetdlv=\"go get -u github.com/go-delve/delve/cmd/dlv\"" >> ~vagrant/.bash_profile echo "user_allow_other" >> /etc/fuse.conf -# Setup Samba - -yum -y install gcc-c++-4.8.5-16.el7_4.2 \ - python-devel-2.7.5-58.el7 \ - gnutls-devel-3.3.26-9.el7 \ - libacl-devel-2.2.51-12.el7 \ - openldap-devel-2.4.44-5.el7 \ - samba-4.6.2-12.el7_4 \ - samba-client-4.6.2-12.el7_4 \ - cifs-utils-6.2-10.el7 -cd /vagrant/src/github.com/swiftstack/ProxyFS/vfs -OS_DISTRO=centos -OS_DISTRO_VERSION=7.4 -SAMBA_VERSION=4.6.12 -SAMBA_DIR=build-samba-`echo $SAMBA_VERSION | tr . -`-${OS_DISTRO}-`echo $OS_DISTRO_VERSION | tr . -` -if [[ -d $SAMBA_DIR ]] -then - if [[ -L $SAMBA_DIR ]] - then - echo "directory symlink \$GOPATH/src/github.com/swiftstack/ProxyFS/vfs/$SAMBA_DIR cannot pre-exist" - exit 1 - else - echo "\$GOPATH/src/github.com/swiftstack/ProxyFS/vfs/$SAMBA_DIR assumed to be as desired" - fi -else - if [[ -L $SAMBA_DIR ]] - then - echo "non-directory symlink \$GOPATH/src/github.com/swiftstack/ProxyFS/vfs/$SAMBA_DIR cannot pre-exist" - exit 1 - else - git clone -b samba-$SAMBA_VERSION --single-branch --depth 1 https://github.com/samba-team/samba.git $SAMBA_DIR - fi -fi -if [[ -L samba ]] -then - samba_symlink_target=`readlink "samba"` - if [[ "$SAMBA_DIR" == "$samba_symlink_target" ]] - then - echo "symlink samba -> $SAMBA_DIR already" - else - echo "redirecting samba -> $SAMBA_DIR" - rm samba - ln -s $SAMBA_DIR samba - fi -else - if [[ -e samba ]] - then - echo "non-symlink \$GOPATH/src/github.com/swiftstack/ProxyFS/vfs/samba cannot pre-exist" - exit 1 - else - echo "establishing samba -> $SAMBA_DIR" - ln -s $SAMBA_DIR samba - fi -fi -cd samba -if [[ -d bin ]] -then - echo "./configure has already been run" -else - ./configure - make clean -fi -if [[ -f bin/default/librpc/gen_ndr/ndr_smb_acl.h ]] -then - echo "make GEN_NDR_TABLES has already been run" -else - make clean - make GEN_NDR_TABLES -fi -echo "export SAMBA_SOURCE=\$GOPATH/src/github.com/swiftstack/ProxyFS/vfs/samba" >> ~vagrant/.bash_profile - # Install Python tox pip install tox==3.5.3 @@ -392,82 +321,12 @@ chmod 777 /var/log chmod 777 /var/log/proxyfsd chmod 666 /var/log/proxyfsd/proxyfsd.log -# Create Mount Points for ProxyFS (FUSE, NFS, & SMB) +# Create Mount Points for ProxyFS (embedded FUSE) rm -rf /CommonMountPoint mkdir /CommonMountPoint chmod 777 /CommonMountPoint -rm -rf /AgentMountPoint -mkdir /AgentMountPoint -chmod 777 /AgentMountPoint - -rm -rf /mnt/nfs_proxyfs_mount -mkdir /mnt/nfs_proxyfs_mount -chmod 777 /mnt/nfs_proxyfs_mount - -rm -rf /mnt/smb_proxyfs_mount -mkdir /mnt/smb_proxyfs_mount -chmod 777 /mnt/smb_proxyfs_mount - -# Configure exports (NFS) / shares (SMB) - -cp /vagrant/src/github.com/swiftstack/ProxyFS/saio/etc/exports /etc/exports -cp /vagrant/src/github.com/swiftstack/ProxyFS/saio/etc/samba/smb.conf /etc/samba/smb.conf -echo -e "swift\nswift" | smbpasswd -a swift - -# Install Kerberos Client to SDOM{1|2|3|4}.LOCAL hosted by sdc{1|2|3|4}.sdom{1|2|3|4}.local - -yum -y install krb5-workstation - -cat >> /etc/hosts << EOF -172.28.128.11 sdc1 sdc1.sdom1.local -172.28.128.12 sdc2 sdc2.sdom2.local -172.28.128.13 sdc3 sdc3.sdom3.local -172.28.128.14 sdc4 sdc4.sdom4.local -172.28.128.21 saio1 saio1.sdom1.local -172.28.128.22 saio2 saio2.sdom2.local -172.28.128.23 saio3 saio3.sdom3.local -172.28.128.24 saio4 saio4.sdom4.local -EOF - -cat > /etc/krb5.conf.d/SambaDCs << EOF -[libdefaults] -dns_lookup_kdc = false - -[realms] -SDOM1.LOCAL = { - admin_server = sdc1.sdom1.local - kdc = sdc1.sdom1.local - default_domain = SDOM1 -} -SDOM2.LOCAL = { - admin_server = sdc2.sdom2.local - kdc=sdc2.sdom2.local - default_domain = SDOM2 -} -SDOM3.LOCAL = { - admin_server = sdc3.sdom3.local - kdc=sdc3.sdom3.local - default_domain = SDOM3 -} -SDOM4.LOCAL = { - admin_server = sdc4.sdom4.local - kdc=sdc4.sdom4.local - default_domain = SDOM4 -} - -[domain_realm] -.sdom1.local = SDOM1.LOCAL -sdom1.local = SDOM1.LOCAL -.sdom2.local = SDOM2.LOCAL -sdom2.local = SDOM2.LOCAL -.sdom3.local = SDOM3.LOCAL -sdom3.local = SDOM3.LOCAL -.sdom4.local = SDOM4.LOCAL -sdom4.local = SDOM4.LOCAL -EOF - # Install systemd .service files for ProxyFS cp /vagrant/src/github.com/swiftstack/ProxyFS/saio/usr/lib/systemd/system/proxyfsd.service /usr/lib/systemd/system/. @@ -550,13 +409,6 @@ EOF systemctl daemon-reload -# Add some VIPs - -ip addr add dev enp0s8 172.28.128.21/24 -ip addr add dev enp0s8 172.28.128.22/24 -ip addr add dev enp0s8 172.28.128.23/24 -ip addr add dev enp0s8 172.28.128.24/24 - # All done echo "SAIO for ProxyFS provisioned" diff --git a/sait/vagrant_provision.sh b/sait/vagrant_provision.sh index 3705f1672..e369f8293 100644 --- a/sait/vagrant_provision.sh +++ b/sait/vagrant_provision.sh @@ -324,7 +324,7 @@ chmod 777 /var/log chmod 777 /var/log/proxyfsd chmod 666 /var/log/proxyfsd/proxyfsd.log -# Create Mount Points for ProxyFS (FUSE, NFS, & SMB) +# Create Mount Points for ProxyFS (embedded FUSE) if [ "$SAIT_INSTANCE" == "1" ] then @@ -333,58 +333,6 @@ then chmod 777 /CommonMountPoint fi -# Install Kerberos Client to SDOM{1|2|3|4}.LOCAL hosted by sdc{1|2|3|4}.sdom{1|2|3|4}.local - -yum -y install krb5-workstation - -cat >> /etc/hosts << EOF -172.28.128.11 sdc1 sdc1.sdom1.local -172.28.128.12 sdc2 sdc2.sdom2.local -172.28.128.13 sdc3 sdc3.sdom3.local -172.28.128.14 sdc4 sdc4.sdom4.local -172.28.128.21 saio1 saio1.sdom1.local -172.28.128.22 saio2 saio2.sdom2.local -172.28.128.23 saio3 saio3.sdom3.local -172.28.128.24 saio4 saio4.sdom4.local -EOF - -cat > /etc/krb5.conf.d/SambaDCs << EOF -[libdefaults] -dns_lookup_kdc = false - -[realms] -SDOM1.LOCAL = { - admin_server = sdc1.sdom1.local - kdc = sdc1.sdom1.local - default_domain = SDOM1 -} -SDOM2.LOCAL = { - admin_server = sdc2.sdom2.local - kdc=sdc2.sdom2.local - default_domain = SDOM2 -} -SDOM3.LOCAL = { - admin_server = sdc3.sdom3.local - kdc=sdc3.sdom3.local - default_domain = SDOM3 -} -SDOM4.LOCAL = { - admin_server = sdc4.sdom4.local - kdc=sdc4.sdom4.local - default_domain = SDOM4 -} - -[domain_realm] -.sdom1.local = SDOM1.LOCAL -sdom1.local = SDOM1.LOCAL -.sdom2.local = SDOM2.LOCAL -sdom2.local = SDOM2.LOCAL -.sdom3.local = SDOM3.LOCAL -sdom3.local = SDOM3.LOCAL -.sdom4.local = SDOM4.LOCAL -sdom4.local = SDOM4.LOCAL -EOF - # Install systemd .service files for ProxyFS cp /vagrant/src/github.com/swiftstack/ProxyFS/sait/sait$SAIT_INSTANCE/usr/lib/systemd/system/proxyfsd.service /usr/lib/systemd/system/. From fa0568b8adb68a9ac046da14ddda1efc0260f9e1 Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Mon, 25 Jan 2021 12:28:22 -0800 Subject: [PATCH 006/160] Initial check-in of IMGR... the replacement for ProxyFS (proxyfsd) --- imgr/Makefile | 6 + imgr/dummy_test.go | 11 + imgr/globals.go | 233 +++++++++++++++++++++ imgr/http_server.go_HIDE | 431 +++++++++++++++++++++++++++++++++++++++ imgr/imgr.conf | 31 +++ imgr/log.go | 75 +++++++ imgr/main.go | 80 ++++++++ 7 files changed, 867 insertions(+) create mode 100644 imgr/Makefile create mode 100644 imgr/dummy_test.go create mode 100644 imgr/globals.go create mode 100644 imgr/http_server.go_HIDE create mode 100644 imgr/imgr.conf create mode 100644 imgr/log.go create mode 100644 imgr/main.go diff --git a/imgr/Makefile b/imgr/Makefile new file mode 100644 index 000000000..f699a7896 --- /dev/null +++ b/imgr/Makefile @@ -0,0 +1,6 @@ +# Copyright (c) 2015-2021, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 + +gosubdir := github.com/swiftstack/ProxyFS/imgr + +include ../GoMakefile diff --git a/imgr/dummy_test.go b/imgr/dummy_test.go new file mode 100644 index 000000000..d42991728 --- /dev/null +++ b/imgr/dummy_test.go @@ -0,0 +1,11 @@ +// Copyright (c) 2015-2021, NVIDIA CORPORATION. +// SPDX-License-Identifier: Apache-2.0 + +package main + +import ( + "testing" +) + +func TestDummy(t *testing.T) { +} diff --git a/imgr/globals.go b/imgr/globals.go new file mode 100644 index 000000000..2f7955d82 --- /dev/null +++ b/imgr/globals.go @@ -0,0 +1,233 @@ +// Copyright (c) 2015-2021, NVIDIA CORPORATION. +// SPDX-License-Identifier: Apache-2.0 + +package main + +import ( + "container/list" + "os" + "sync" + "time" + + "github.com/swiftstack/ProxyFS/bucketstats" + "github.com/swiftstack/ProxyFS/conf" +) + +type configStruct struct { + PrivateIPAddr string + PublicIPAddr string + JSONRPCPort uint16 // To be served only on PrivateIPAddr via TCP + RetryRPCPort uint16 // To be served only on PublicIPAddr via TLS + HTTPServerPort uint16 // To be served only on PrivateIPAddr via TCP + + RetryRPCTTLCompleted time.Duration + RetryRPCAckTrim time.Duration + RetryRPCDeadlineIO time.Duration + RetryRPCKeepAlivePeriod time.Duration + + MinLeaseDuration time.Duration + LeaseInterruptInterval time.Duration + LeaseInterruptLimit uint32 + + SwiftNoAuthIPAddr string + SwiftNoAuthTCPPort uint16 + + SwiftRetryDelay time.Duration + SwiftRetryExpBackoff float64 + SwiftRetryLimit uint32 + + SwiftConnectionPoolSize uint32 + + LogFilePath string // Unless starting with '/', relative to $CWD; == "" means disabled + LogToConsole bool + TraceEnabled bool +} + +type chunkedPutContextStruct struct { + sync.WaitGroup // Used to await completion of performChunkedPut goroutine + containerName string // + objectName string // + buf []byte // + chunkedPutListElement *list.Element // FIFO Element of fileInodeStruct.chunkedPutList + state uint8 // One of chunkedPutContextState{Open|Closing|Closed} + pos int // ObjectOffset just after last sent chunk + sendChan chan struct{} // Single element buffered chan to wake up *chunkedPutContextStruct.sendDaemon() + // will be closed to indicate a flush is requested + wakeChan chan struct{} // Single element buffered chan to wake up *chunkedPutContextStruct.Read() + // will be closed to indicate a flush is requested + inRead bool // Set when in Read() as a hint to Close() to help Read() cleanly exit + flushRequested bool // Set to remember that a flush has been requested of *chunkedPutContextStruct.Read() +} + +type statsStruct struct { + SharedLeaseRequests bucketstats.BucketLog2Round + PromoteLeaseRequests bucketstats.BucketLog2Round + ExclusiveLeaseRequests bucketstats.BucketLog2Round + DemoteLeaseRequests bucketstats.BucketLog2Round + ReleaseLeaseRequests bucketstats.BucketLog2Round + + DemoteLeaseInterrupts bucketstats.Totaler + RevokeLeaseInterrupts bucketstats.Totaler + + InodeGets bucketstats.BucketLog2Round + InodePuts bucketstats.BucketLog2Round +} + +type globalsStruct struct { + sync.RWMutex + config configStruct + logFile *os.File // == nil if config.LogFilePath == "" + stats *statsStruct +} + +var globals globalsStruct + +func initializeGlobals(confMap conf.ConfMap) { + var ( + err error + ) + + // Default logging related globals + + globals.config.LogFilePath = "" + globals.config.LogToConsole = true + globals.logFile = nil + + // Process resultant confMap + + globals.config.PublicIPAddr, err = confMap.FetchOptionValueString("IMGR", "PublicIPAddr") + if nil != err { + logFatal(err) + } + globals.config.PrivateIPAddr, err = confMap.FetchOptionValueString("IMGR", "PrivateIPAddr") + if nil != err { + logFatal(err) + } + globals.config.JSONRPCPort, err = confMap.FetchOptionValueUint16("IMGR", "JSONRPCPort") + if nil != err { + logFatal(err) + } + globals.config.RetryRPCPort, err = confMap.FetchOptionValueUint16("IMGR", "RetryRPCPort") + if nil != err { + logFatal(err) + } + globals.config.HTTPServerPort, err = confMap.FetchOptionValueUint16("IMGR", "HTTPServerPort") + if nil != err { + logFatal(err) + } + globals.config.HTTPServerPort, err = confMap.FetchOptionValueUint16("IMGR", "HTTPServerPort") + if nil != err { + logFatal(err) + } + + globals.config.RetryRPCTTLCompleted, err = confMap.FetchOptionValueDuration("IMGR", "RetryRPCTTLCompleted") + if nil != err { + logFatal(err) + } + globals.config.RetryRPCAckTrim, err = confMap.FetchOptionValueDuration("IMGR", "RetryRPCAckTrim") + if nil != err { + logFatal(err) + } + globals.config.RetryRPCDeadlineIO, err = confMap.FetchOptionValueDuration("IMGR", "RetryRPCDeadlineIO") + if nil != err { + logFatal(err) + } + globals.config.RetryRPCKeepAlivePeriod, err = confMap.FetchOptionValueDuration("IMGR", "RetryRPCKeepAlivePeriod") + if nil != err { + logFatal(err) + } + + globals.config.MinLeaseDuration, err = confMap.FetchOptionValueDuration("IMGR", "MinLeaseDuration") + if nil != err { + logFatal(err) + } + globals.config.LeaseInterruptInterval, err = confMap.FetchOptionValueDuration("IMGR", "LeaseInterruptInterval") + if nil != err { + logFatal(err) + } + globals.config.LeaseInterruptLimit, err = confMap.FetchOptionValueUint32("IMGR", "LeaseInterruptLimit") + if nil != err { + logFatal(err) + } + + globals.config.SwiftNoAuthIPAddr, err = confMap.FetchOptionValueString("IMGR", "SwiftNoAuthIPAddr") + if nil != err { + logFatal(err) + } + globals.config.SwiftNoAuthTCPPort, err = confMap.FetchOptionValueUint16("IMGR", "SwiftNoAuthTCPPort") + if nil != err { + logFatal(err) + } + + globals.config.SwiftRetryDelay, err = confMap.FetchOptionValueDuration("IMGR", "SwiftRetryDelay") + if nil != err { + logFatal(err) + } + globals.config.SwiftRetryExpBackoff, err = confMap.FetchOptionValueFloat64("IMGR", "SwiftRetryExpBackoff") + if nil != err { + logFatal(err) + } + globals.config.SwiftRetryLimit, err = confMap.FetchOptionValueUint32("IMGR", "SwiftRetryLimit") + if nil != err { + logFatal(err) + } + + globals.config.SwiftConnectionPoolSize, err = confMap.FetchOptionValueUint32("IMGR", "SwiftConnectionPoolSize") + if nil != err { + logFatal(err) + } + + globals.config.LogFilePath, err = confMap.FetchOptionValueString("IMGR", "LogFilePath") + if nil != err { + err = confMap.VerifyOptionValueIsEmpty("IMGR", "LogFilePath") + if nil == err { + globals.config.LogFilePath = "" + } else { + logFatalf("[IMGR]LogFilePath must either be a valid string or empty]") + } + } + globals.config.LogToConsole, err = confMap.FetchOptionValueBool("IMGR", "LogToConsole") + if nil != err { + logFatal(err) + } + globals.config.TraceEnabled, err = confMap.FetchOptionValueBool("IMGR", "TraceEnabled") + if nil != err { + logFatal(err) + } + + globals.stats = &statsStruct{} + + bucketstats.Register("IMGR", "", globals.stats) +} + +func uninitializeGlobals() { + globals.config.PrivateIPAddr = "" + globals.config.PublicIPAddr = "" + globals.config.JSONRPCPort = 0 + globals.config.RetryRPCPort = 0 + globals.config.HTTPServerPort = 0 + + globals.config.RetryRPCTTLCompleted = time.Duration(0) + globals.config.RetryRPCAckTrim = time.Duration(0) + globals.config.RetryRPCDeadlineIO = time.Duration(0) + globals.config.RetryRPCKeepAlivePeriod = time.Duration(0) + + globals.config.MinLeaseDuration = time.Duration(0) + globals.config.LeaseInterruptInterval = time.Duration(0) + globals.config.LeaseInterruptLimit = 0 + + globals.config.SwiftNoAuthIPAddr = "" + globals.config.SwiftNoAuthTCPPort = 0 + + globals.config.SwiftRetryDelay = time.Duration(0) + globals.config.SwiftRetryExpBackoff = 0.0 + globals.config.SwiftRetryLimit = 0 + + globals.config.SwiftConnectionPoolSize = 0 + + globals.config.LogFilePath = "" + globals.config.LogToConsole = false + globals.config.TraceEnabled = false + + bucketstats.UnRegister("IMGR", "") +} diff --git a/imgr/http_server.go_HIDE b/imgr/http_server.go_HIDE new file mode 100644 index 000000000..486d54b13 --- /dev/null +++ b/imgr/http_server.go_HIDE @@ -0,0 +1,431 @@ +// Copyright (c) 2015-2021, NVIDIA CORPORATION. +// SPDX-License-Identifier: Apache-2.0 + +package main + +import ( + "bytes" + "container/list" + "context" + "encoding/json" + "fmt" + "log" + "net" + "net/http" + "net/http/pprof" + "reflect" + "runtime" + "strconv" + "strings" + "sync/atomic" + + "github.com/swiftstack/sortedmap" + + "github.com/swiftstack/ProxyFS/bucketstats" + "github.com/swiftstack/ProxyFS/version" +) + +type leaseReportStruct struct { + MountID string + None []string // inode.InodeNumber in 16-digit Hex (no leading "0x") + SharedRequested []string + SharedGranted []string + SharedPromoting []string + SharedReleasing []string + ExclusiveRequested []string + ExclusiveGranted []string + ExclusiveDemoting []string + ExclusiveReleasing []string +} + +func serveHTTP() { + var ( + ipAddrTCPPort string + ) + + ipAddrTCPPort = net.JoinHostPort(globals.config.HTTPServerIPAddr, strconv.Itoa(int(globals.config.HTTPServerTCPPort))) + + globals.httpServer = &http.Server{ + Addr: ipAddrTCPPort, + Handler: &globals, + } + + globals.httpServerWG.Add(1) + + go func() { + var ( + err error + ) + + err = globals.httpServer.ListenAndServe() + if http.ErrServerClosed != err { + log.Fatalf("httpServer.ListenAndServe() exited unexpectedly: %v", err) + } + + globals.httpServerWG.Done() + }() +} + +func unserveHTTP() { + var ( + err error + ) + + err = globals.httpServer.Shutdown(context.TODO()) + if nil != err { + log.Fatalf("httpServer.Shutdown() returned with an error: %v", err) + } + + globals.httpServerWG.Wait() +} + +func (dummy *globalsStruct) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) { + switch request.Method { + case http.MethodGet: + serveGet(responseWriter, request) + default: + responseWriter.WriteHeader(http.StatusMethodNotAllowed) + } +} + +func serveGet(responseWriter http.ResponseWriter, request *http.Request) { + var ( + path string + ) + + path = strings.TrimRight(request.URL.Path, "/") + + switch { + case "" == path: + serveGetOfIndexDotHTML(responseWriter, request) + case "/config" == path: + serveGetOfConfig(responseWriter, request) + case "/debug/pprof/cmdline" == path: + pprof.Cmdline(responseWriter, request) + case "/debug/pprof/profile" == path: + pprof.Profile(responseWriter, request) + case "/debug/pprof/symbol" == path: + pprof.Symbol(responseWriter, request) + case "/debug/pprof/trace" == path: + pprof.Trace(responseWriter, request) + case strings.HasPrefix(path, "/debug/pprof"): + pprof.Index(responseWriter, request) + case "index.html" == path: + serveGetOfIndexDotHTML(responseWriter, request) + case "/leases" == path: + serveGetOfLeases(responseWriter, request) + case "/metrics" == path: + serveGetOfMetrics(responseWriter, request) + case "/stats" == path: + serveGetOfStats(responseWriter, request) + case "/version" == path: + serveGetOfVersion(responseWriter, request) + default: + responseWriter.WriteHeader(http.StatusNotFound) + } +} + +func serveGetOfConfig(responseWriter http.ResponseWriter, request *http.Request) { + var ( + confMapJSON bytes.Buffer + confMapJSONPacked []byte + ok bool + paramList []string + sendPackedConfig bool + ) + + paramList, ok = request.URL.Query()["compact"] + if ok { + if 0 == len(paramList) { + sendPackedConfig = false + } else { + sendPackedConfig = !((paramList[0] == "") || (paramList[0] == "0") || (paramList[0] == "false")) + } + } else { + sendPackedConfig = false + } + + confMapJSONPacked, _ = json.Marshal(globals.config) + + responseWriter.Header().Set("Content-Type", "application/json") + responseWriter.WriteHeader(http.StatusOK) + + if sendPackedConfig { + _, _ = responseWriter.Write(confMapJSONPacked) + } else { + json.Indent(&confMapJSON, confMapJSONPacked, "", "\t") + _, _ = responseWriter.Write(confMapJSON.Bytes()) + _, _ = responseWriter.Write([]byte("\n")) + } +} + +func serveGetOfIndexDotHTML(responseWriter http.ResponseWriter, request *http.Request) { + responseWriter.Header().Set("Content-Type", "text/html") + responseWriter.WriteHeader(http.StatusOK) + _, _ = responseWriter.Write([]byte(fmt.Sprintf(indexDotHTMLTemplate, net.JoinHostPort(globals.config.HTTPServerIPAddr, strconv.Itoa(int(globals.config.HTTPServerTCPPort)))))) +} + +func serveGetOfLeases(responseWriter http.ResponseWriter, request *http.Request) { + var ( + fileInode *fileInodeStruct + leaseListElement *list.Element + leaseReport *leaseReportStruct + leaseReportJSON bytes.Buffer + leaseReportJSONPacked []byte + ok bool + paramList []string + sendPackedLeaseReport bool + ) + + leaseReport = &leaseReportStruct{ + MountID: fmt.Sprintf("%s", globals.mountID), + None: make([]string, 0), + SharedRequested: make([]string, 0), + SharedGranted: make([]string, 0), + SharedPromoting: make([]string, 0), + SharedReleasing: make([]string, 0), + ExclusiveRequested: make([]string, 0), + ExclusiveGranted: make([]string, 0), + ExclusiveDemoting: make([]string, 0), + ExclusiveReleasing: make([]string, 0), + } + + globals.Lock() + + for leaseListElement = globals.unleasedFileInodeCacheLRU.Front(); leaseListElement != nil; leaseListElement = leaseListElement.Next() { + fileInode = leaseListElement.Value.(*fileInodeStruct) + switch fileInode.leaseState { + case fileInodeLeaseStateNone: + leaseReport.None = append(leaseReport.None, fmt.Sprintf("%016X", fileInode.InodeNumber)) + case fileInodeLeaseStateSharedReleasing: + leaseReport.SharedReleasing = append(leaseReport.SharedReleasing, fmt.Sprintf("%016X", fileInode.InodeNumber)) + case fileInodeLeaseStateExclusiveReleasing: + leaseReport.ExclusiveReleasing = append(leaseReport.ExclusiveReleasing, fmt.Sprintf("%016X", fileInode.InodeNumber)) + default: + logFatalf("serveGetOfLeases() found unexpected fileInode.leaseState %v on globals.unleasedFileInodeCacheLRU", fileInode.leaseState) + } + } + + for leaseListElement = globals.sharedLeaseFileInodeCacheLRU.Front(); leaseListElement != nil; leaseListElement = leaseListElement.Next() { + fileInode = leaseListElement.Value.(*fileInodeStruct) + switch fileInode.leaseState { + case fileInodeLeaseStateSharedRequested: + leaseReport.SharedRequested = append(leaseReport.SharedRequested, fmt.Sprintf("%016X", fileInode.InodeNumber)) + case fileInodeLeaseStateSharedGranted: + leaseReport.SharedGranted = append(leaseReport.SharedGranted, fmt.Sprintf("%016X", fileInode.InodeNumber)) + case fileInodeLeaseStateExclusiveDemoting: + leaseReport.ExclusiveDemoting = append(leaseReport.ExclusiveDemoting, fmt.Sprintf("%016X", fileInode.InodeNumber)) + default: + logFatalf("serveGetOfLeases() found unexpected fileInode.leaseState %v on globals.sharedLeaseFileInodeCacheLRU", fileInode.leaseState) + } + } + + for leaseListElement = globals.exclusiveLeaseFileInodeCacheLRU.Front(); leaseListElement != nil; leaseListElement = leaseListElement.Next() { + fileInode = leaseListElement.Value.(*fileInodeStruct) + switch fileInode.leaseState { + case fileInodeLeaseStateSharedPromoting: + leaseReport.SharedPromoting = append(leaseReport.SharedPromoting, fmt.Sprintf("%016X", fileInode.InodeNumber)) + case fileInodeLeaseStateExclusiveRequested: + leaseReport.ExclusiveRequested = append(leaseReport.ExclusiveRequested, fmt.Sprintf("%016X", fileInode.InodeNumber)) + case fileInodeLeaseStateExclusiveGranted: + leaseReport.ExclusiveGranted = append(leaseReport.ExclusiveGranted, fmt.Sprintf("%016X", fileInode.InodeNumber)) + default: + logFatalf("serveGetOfLeases() found unexpected fileInode.leaseState %v on globals.exclusiveLeaseFileInodeCacheLRU", fileInode.leaseState) + } + } + + globals.Unlock() + + paramList, ok = request.URL.Query()["compact"] + if ok { + if 0 == len(paramList) { + sendPackedLeaseReport = false + } else { + sendPackedLeaseReport = !((paramList[0] == "") || (paramList[0] == "0") || (paramList[0] == "false")) + } + } else { + sendPackedLeaseReport = false + } + + leaseReportJSONPacked, _ = json.Marshal(leaseReport) + + responseWriter.Header().Set("Content-Type", "application/json") + responseWriter.WriteHeader(http.StatusOK) + + if sendPackedLeaseReport { + _, _ = responseWriter.Write(leaseReportJSONPacked) + } else { + json.Indent(&leaseReportJSON, leaseReportJSONPacked, "", "\t") + _, _ = responseWriter.Write(leaseReportJSON.Bytes()) + _, _ = responseWriter.Write([]byte("\n")) + } +} + +func serveGetOfMetrics(responseWriter http.ResponseWriter, request *http.Request) { + var ( + err error + format string + i int + keyAsKey sortedmap.Key + keyAsString string + line string + longestKeyAsString int + longestValueAsString int + memStats runtime.MemStats + metricsFieldName string + metricsFieldValuePtr *uint64 + metricsLLRB sortedmap.LLRBTree + metricsLLRBLen int + metricsStructValue reflect.Value + metricsValue reflect.Value + ok bool + pauseNsAccumulator uint64 + valueAsString string + valueAsValue sortedmap.Value + ) + + runtime.ReadMemStats(&memStats) + + metricsLLRB = sortedmap.NewLLRBTree(sortedmap.CompareString, nil) + + // General statistics. + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_Alloc", memStats.Alloc) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_TotalAlloc", memStats.TotalAlloc) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_Sys", memStats.Sys) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_Lookups", memStats.Lookups) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_Mallocs", memStats.Mallocs) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_Frees", memStats.Frees) + + // Main allocation heap statistics. + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_HeapAlloc", memStats.HeapAlloc) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_HeapSys", memStats.HeapSys) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_HeapIdle", memStats.HeapIdle) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_HeapInuse", memStats.HeapInuse) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_HeapReleased", memStats.HeapReleased) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_HeapObjects", memStats.HeapObjects) + + // Low-level fixed-size structure allocator statistics. + // Inuse is bytes used now. + // Sys is bytes obtained from system. + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_StackInuse", memStats.StackInuse) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_StackSys", memStats.StackSys) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_MSpanInuse", memStats.MSpanInuse) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_MSpanSys", memStats.MSpanSys) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_MCacheInuse", memStats.MCacheInuse) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_MCacheSys", memStats.MCacheSys) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_BuckHashSys", memStats.BuckHashSys) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_GCSys", memStats.GCSys) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_OtherSys", memStats.OtherSys) + + // Garbage collector statistics (fixed portion). + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_LastGC", memStats.LastGC) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_PauseTotalNs", memStats.PauseTotalNs) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_NumGC", uint64(memStats.NumGC)) + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_GCCPUPercentage", uint64(100.0*memStats.GCCPUFraction)) + + // Garbage collector statistics (go_runtime_MemStats_PauseAverageNs). + if 0 == memStats.NumGC { + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_PauseAverageNs", 0) + } else { + pauseNsAccumulator = 0 + if memStats.NumGC < 255 { + for i = 0; i < int(memStats.NumGC); i++ { + pauseNsAccumulator += memStats.PauseNs[i] + } + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_PauseAverageNs", pauseNsAccumulator/uint64(memStats.NumGC)) + } else { + for i = 0; i < 256; i++ { + pauseNsAccumulator += memStats.PauseNs[i] + } + insertInMetricsLLRB(metricsLLRB, "go_runtime_MemStats_PauseAverageNs", pauseNsAccumulator/256) + } + } + + // Add in locally generated metrics + + metricsStructValue = reflect.Indirect(reflect.ValueOf(globals.metrics)) + metricsValue = reflect.ValueOf(globals.metrics).Elem() + + for i = 0; i < metricsStructValue.NumField(); i++ { + metricsFieldName = metricsStructValue.Type().Field(i).Name + metricsFieldValuePtr = metricsValue.Field(i).Addr().Interface().(*uint64) + insertInMetricsLLRB(metricsLLRB, metricsFieldName, atomic.LoadUint64(metricsFieldValuePtr)) + } + + // Produce sorted and column-aligned response + + responseWriter.Header().Set("Content-Type", "text/plain") + responseWriter.WriteHeader(http.StatusOK) + + metricsLLRBLen, err = metricsLLRB.Len() + if nil != err { + logFatalf("metricsLLRB.Len() failed: %v", err) + } + + longestKeyAsString = 0 + longestValueAsString = 0 + + for i = 0; i < metricsLLRBLen; i++ { + keyAsKey, valueAsValue, ok, err = metricsLLRB.GetByIndex(i) + if nil != err { + logFatalf("llrb.GetByIndex(%v) failed: %v", i, err) + } + if !ok { + logFatalf("llrb.GetByIndex(%v) returned ok == false", i) + } + keyAsString = keyAsKey.(string) + valueAsString = valueAsValue.(string) + if len(keyAsString) > longestKeyAsString { + longestKeyAsString = len(keyAsString) + } + if len(valueAsString) > longestValueAsString { + longestValueAsString = len(valueAsString) + } + } + + format = fmt.Sprintf("%%-%vs %%%vs\n", longestKeyAsString, longestValueAsString) + + for i = 0; i < metricsLLRBLen; i++ { + keyAsKey, valueAsValue, ok, err = metricsLLRB.GetByIndex(i) + if nil != err { + logFatalf("llrb.GetByIndex(%v) failed: %v", i, err) + } + if !ok { + logFatalf("llrb.GetByIndex(%v) returned ok == false", i) + } + keyAsString = keyAsKey.(string) + valueAsString = valueAsValue.(string) + line = fmt.Sprintf(format, keyAsString, valueAsString) + _, _ = responseWriter.Write([]byte(line)) + } +} + +func serveGetOfStats(responseWriter http.ResponseWriter, request *http.Request) { + responseWriter.Header().Set("Content-Type", "text/plain") + responseWriter.WriteHeader(http.StatusOK) + _, _ = responseWriter.Write([]byte(bucketstats.SprintStats(bucketstats.StatFormatParsable1, "*", "*"))) +} + +func insertInMetricsLLRB(metricsLLRB sortedmap.LLRBTree, metricKey string, metricValueAsUint64 uint64) { + var ( + err error + metricValueAsString string + ok bool + ) + + metricValueAsString = fmt.Sprintf("%v", metricValueAsUint64) + + ok, err = metricsLLRB.Put(metricKey, metricValueAsString) + if nil != err { + logFatalf("metricsLLRB.Put(%v, %v) failed: %v", metricKey, metricValueAsString, err) + } + if !ok { + logFatalf("metricsLLRB.Put(%v, %v) returned ok == false", metricKey, metricValueAsString) + } +} + +func serveGetOfVersion(responseWriter http.ResponseWriter, request *http.Request) { + responseWriter.Header().Set("Content-Type", "text/plain") + responseWriter.WriteHeader(http.StatusOK) + _, _ = responseWriter.Write([]byte(version.ProxyFSVersion)) +} diff --git a/imgr/imgr.conf b/imgr/imgr.conf new file mode 100644 index 000000000..d471c93b3 --- /dev/null +++ b/imgr/imgr.conf @@ -0,0 +1,31 @@ +# Copyright (c) 2015-2021, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 + +[IMGR] +PublicIPAddr: 0.0.0.0 +PrivateIPAddr: 0.0.0.0 +JSONRPCPort: 12345 +RetryRPCPort: 32356 +HTTPServerPort: 15346 + +RetryRPCTTLCompleted: 10m +RetryRPCAckTrim: 100ms +RetryRPCDeadlineIO: 60s +RetryRPCKeepAlivePeriod: 60s + +MinLeaseDuration: 250ms +LeaseInterruptInterval: 250ms +LeaseInterruptLimit: 20 + +SwiftNoAuthIPAddr: 127.0.0.1 +SwiftNoAuthTCPPort: 8090 + +SwiftRetryDelay: 1s +SwiftRetryExpBackoff: 1.5 +SwiftRetryLimit: 11 + +SwiftConnectionPoolSize: 128 + +LogFilePath: # imgr.log +LogToConsole: true # false +TraceEnabled: false diff --git a/imgr/log.go b/imgr/log.go new file mode 100644 index 000000000..3736ab567 --- /dev/null +++ b/imgr/log.go @@ -0,0 +1,75 @@ +// Copyright (c) 2015-2021, NVIDIA CORPORATION. +// SPDX-License-Identifier: Apache-2.0 + +package main + +import ( + "fmt" + "os" + "time" +) + +func logFatal(err error) { + logf("FATAL", "%v", err) + os.Exit(1) +} + +func logFatalf(format string, args ...interface{}) { + logf("FATAL", format, args...) + os.Exit(1) +} + +func logErrorf(format string, args ...interface{}) { + logf("ERROR", format, args...) +} + +func logWarnf(format string, args ...interface{}) { + logf("WARN", format, args...) +} + +func logInfof(format string, args ...interface{}) { + logf("INFO", format, args...) +} + +func logTracef(format string, args ...interface{}) { + if globals.config.TraceEnabled { + logf("TRACE", format, args...) + } +} + +func logf(level string, format string, args ...interface{}) { + var ( + enhancedArgs []interface{} + enhancedFormat string + err error + logMsg string + ) + + enhancedFormat = "[%s][%s] " + format + enhancedArgs = append([]interface{}{time.Now().Format(time.RFC3339Nano), level}, args...) + + logMsg = fmt.Sprintf(enhancedFormat, enhancedArgs[:]...) + + if nil == globals.logFile { + if "" != globals.config.LogFilePath { + globals.logFile, err = os.OpenFile(globals.config.LogFilePath, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0666) + if nil == err { + _, _ = globals.logFile.WriteString(logMsg + "\n") + } else { + globals.logFile = nil + } + } + } else { + globals.logFile.WriteString(logMsg + "\n") + } + if globals.config.LogToConsole { + fmt.Fprintln(os.Stderr, logMsg) + } +} + +func logSIGHUP() { + if nil != globals.logFile { + _ = globals.logFile.Close() + globals.logFile = nil + } +} diff --git a/imgr/main.go b/imgr/main.go new file mode 100644 index 000000000..9a86ffee9 --- /dev/null +++ b/imgr/main.go @@ -0,0 +1,80 @@ +// Copyright (c) 2015-2021, NVIDIA CORPORATION. +// SPDX-License-Identifier: Apache-2.0 + +package main + +import ( + "log" + "os" + "os/signal" + + "golang.org/x/sys/unix" + + "github.com/swiftstack/ProxyFS/conf" +) + +func main() { + var ( + confMap conf.ConfMap + err error + signalChan chan os.Signal + signalReceived os.Signal + ) + + if len(os.Args) < 2 { + log.Fatalf("no .conf file specified") + } + + // Parse arguments (at this point, logging goes only to the console) + + globals.logFile = nil + globals.config.LogFilePath = "" + globals.config.LogToConsole = true + + confMap, err = conf.MakeConfMapFromFile(os.Args[1]) + if nil != err { + log.Fatalf("failed to load config: %v", err) + } + + err = confMap.UpdateFromStrings(os.Args[2:]) + if nil != err { + log.Fatalf("failed to apply config overrides: %v", err) + } + + // Arm signal handler used to indicate termination and wait on it + // + // Note: signalled chan must be buffered to avoid race with window between + // arming handler and blocking on the chan read + + signalChan = make(chan os.Signal, 1) + + signal.Notify(signalChan, unix.SIGINT, unix.SIGTERM, unix.SIGHUP) + + // Initialize globals + + initializeGlobals(confMap) + + // Indicate we are UP + + logInfof("UP") + + // Await any of specified signals or fission exit + + for { + signalReceived = <-signalChan + logInfof("Received signal: %v", signalReceived) + if unix.SIGHUP == signalReceived { + logSIGHUP() + } else { + break + } + } + + // Indicate we are DOWN + + logInfof("DOWN") + + // Uninitialize globals + + uninitializeGlobals() +} From 4218b30cdc2b098e1a7b863860ee63935f8bc23b Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Mon, 25 Jan 2021 12:30:51 -0800 Subject: [PATCH 007/160] Disable "before_install" Travis doing a `git submodule update` --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 82bafdb6b..e64ba31f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,9 +13,5 @@ notifications: on_failure: always on_pull_requests: true -before_install: -- sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules -- git submodule update --init --recursive - script: - docker run -e "COVERALLS_TOKEN=$COVERALLS_TOKEN" -e "TRAVIS_BRANCH=$TRAVIS_BRANCH" --cap-add SYS_ADMIN --device /dev/fuse -it -v `pwd`:/gopathroot/src/github.com/swiftstack/ProxyFS swiftstack/proxyfs_unit_tests From 06ca1cbf1cb906a2046888187ed6b847c1478301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerard=20Gin=C3=A9?= Date: Mon, 25 Jan 2021 13:25:08 -0800 Subject: [PATCH 008/160] Remove SMB/VFS stuff from TravisCI --- test/container/launch.sh | 64 +++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/test/container/launch.sh b/test/container/launch.sh index 09ff8dd8a..3dee2a1ec 100755 --- a/test/container/launch.sh +++ b/test/container/launch.sh @@ -6,37 +6,39 @@ set -e set -x -# Setup Samba -# Ideally, these 3 vars should be populated with info from the system. -# For now, it's just hardcoded. -OS_DISTRO=centos -OS_DISTRO_VERSION=7.4 -SAMBA_VERSION=4.6.12 - -SAMBA_DIR=build-samba-`echo $SAMBA_VERSION | tr . -`-${OS_DISTRO}-`echo $OS_DISTRO_VERSION | tr . -` - -cd $GOPATH/src/github.com/swiftstack/ProxyFS/vfs - -if [[ -L samba ]]; then - rm samba -else - if [[ -e samba ]]; then - echo "non-symlink \$GOPATH/src/github.com/swiftstack/ProxyFS/vfs/samba cannot pre-exist" - exit 1 - fi -fi - -if [[ -d "${SAMBA_DIR}" ]]; then - ln -s $SAMBA_DIR samba -else - git clone -b samba-$SAMBA_VERSION --single-branch --depth 1 https://github.com/samba-team/samba.git $SAMBA_DIR - ln -s $SAMBA_DIR samba - cd samba - ./configure - make clean - make GEN_NDR_TABLES -fi -export SAMBA_SOURCE=$GOPATH/src/github.com/swiftstack/ProxyFS/vfs/samba +# TODO: We don't need this anymore, do we? Delete when we're 100% sure! +## Setup Samba +## Ideally, these 3 vars should be populated with info from the system. +## For now, it's just hardcoded. +#OS_DISTRO=centos +#OS_DISTRO_VERSION=7.4 +#SAMBA_VERSION=4.6.12 +# +#SAMBA_DIR=build-samba-`echo $SAMBA_VERSION | tr . -`-${OS_DISTRO}-`echo $OS_DISTRO_VERSION | tr . -` +# +#cd $GOPATH/src/github.com/swiftstack/ProxyFS/vfs +# +#if [[ -L samba ]]; then +# rm samba +#else +# if [[ -e samba ]]; then +# echo "non-symlink \$GOPATH/src/github.com/swiftstack/ProxyFS/vfs/samba cannot pre-exist" +# exit 1 +# fi +#fi +# +#if [[ -d "${SAMBA_DIR}" ]]; then +# ln -s $SAMBA_DIR samba +#else +# git clone -b samba-$SAMBA_VERSION --single-branch --depth 1 https://github.com/samba-team/samba.git $SAMBA_DIR +# ln -s $SAMBA_DIR samba +# cd samba +# ./configure +# make clean +# make GEN_NDR_TABLES +#fi +#export SAMBA_SOURCE=$GOPATH/src/github.com/swiftstack/ProxyFS/vfs/samba +# TODO: End of to-do # Build ProxyFS and run tests cd $GOPATH/src/github.com/swiftstack/ProxyFS From 22c6008fd5766228aebba7cbdd992d851cf53f90 Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Mon, 25 Jan 2021 14:01:27 -0800 Subject: [PATCH 009/160] Went ahead and removed the commented out lines referring to Samba in test/container/launch.sh --- test/container/launch.sh | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/test/container/launch.sh b/test/container/launch.sh index 3dee2a1ec..4df25c0d8 100755 --- a/test/container/launch.sh +++ b/test/container/launch.sh @@ -6,40 +6,6 @@ set -e set -x -# TODO: We don't need this anymore, do we? Delete when we're 100% sure! -## Setup Samba -## Ideally, these 3 vars should be populated with info from the system. -## For now, it's just hardcoded. -#OS_DISTRO=centos -#OS_DISTRO_VERSION=7.4 -#SAMBA_VERSION=4.6.12 -# -#SAMBA_DIR=build-samba-`echo $SAMBA_VERSION | tr . -`-${OS_DISTRO}-`echo $OS_DISTRO_VERSION | tr . -` -# -#cd $GOPATH/src/github.com/swiftstack/ProxyFS/vfs -# -#if [[ -L samba ]]; then -# rm samba -#else -# if [[ -e samba ]]; then -# echo "non-symlink \$GOPATH/src/github.com/swiftstack/ProxyFS/vfs/samba cannot pre-exist" -# exit 1 -# fi -#fi -# -#if [[ -d "${SAMBA_DIR}" ]]; then -# ln -s $SAMBA_DIR samba -#else -# git clone -b samba-$SAMBA_VERSION --single-branch --depth 1 https://github.com/samba-team/samba.git $SAMBA_DIR -# ln -s $SAMBA_DIR samba -# cd samba -# ./configure -# make clean -# make GEN_NDR_TABLES -#fi -#export SAMBA_SOURCE=$GOPATH/src/github.com/swiftstack/ProxyFS/vfs/samba -# TODO: End of to-do - # Build ProxyFS and run tests cd $GOPATH/src/github.com/swiftstack/ProxyFS make ci From 9c6388c19dbaad193224f712fdf4601ca9c84b8f Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Mon, 25 Jan 2021 14:05:19 -0800 Subject: [PATCH 010/160] Added imgr to top-level Makefile --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 3fad56c34..8922c0d25 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,7 @@ gopkgsubdirs = \ gobinsubdirs = \ cleanproxyfs \ fsworkout \ + imgr \ inodeworkout \ pfs-crash \ pfs-fsck \ @@ -59,6 +60,7 @@ gobinsubdirs = \ ramswift/ramswift gobinsubdirsforci = \ + imgr \ pfsconfjson \ pfsconfjsonpacked \ confgen/confgen \ From 540cb7adb22362e203fbb07c1fb6024dbf62bdc8 Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Mon, 25 Jan 2021 17:53:28 -0800 Subject: [PATCH 011/160] cp - a lot of recasting of ramswift -> emswift to capture --- Makefile | 6 +- emswift/Makefile | 6 + emswift/dummy_test.go | 11 + emswift/emswift.conf | 15 + emswift/emswiftpkg/Makefile | 6 + emswift/emswiftpkg/api.go | 23 + emswift/emswiftpkg/dummy_test.go | 11 + emswift/emswiftpkg/impl.go | 1542 +++++++++++++++++ .../emswiftpkg/setup_teardown_test.go_HIDE | 369 ++++ .../swift_proxy_emulator_test.go_HIDE | 411 +++++ emswift/main.go | 69 + imgr/imgrpkg/Makefile | 6 + imgr/imgrpkg/dummy.go | 4 + imgr/imgrpkg/dummy_test.go | 11 + 14 files changed, 2489 insertions(+), 1 deletion(-) create mode 100644 emswift/Makefile create mode 100644 emswift/dummy_test.go create mode 100644 emswift/emswift.conf create mode 100644 emswift/emswiftpkg/Makefile create mode 100644 emswift/emswiftpkg/api.go create mode 100644 emswift/emswiftpkg/dummy_test.go create mode 100644 emswift/emswiftpkg/impl.go create mode 100644 emswift/emswiftpkg/setup_teardown_test.go_HIDE create mode 100644 emswift/emswiftpkg/swift_proxy_emulator_test.go_HIDE create mode 100644 emswift/main.go create mode 100644 imgr/imgrpkg/Makefile create mode 100644 imgr/imgrpkg/dummy.go create mode 100644 imgr/imgrpkg/dummy_test.go diff --git a/Makefile b/Makefile index 8922c0d25..e78d746ad 100644 --- a/Makefile +++ b/Makefile @@ -32,10 +32,13 @@ gopkgsubdirs = \ transitions \ trackedlock \ utils \ - version + version \ + emswift/emswiftpkg \ + imgr/imgrpkg gobinsubdirs = \ cleanproxyfs \ + emswift \ fsworkout \ imgr \ inodeworkout \ @@ -60,6 +63,7 @@ gobinsubdirs = \ ramswift/ramswift gobinsubdirsforci = \ + emswift \ imgr \ pfsconfjson \ pfsconfjsonpacked \ diff --git a/emswift/Makefile b/emswift/Makefile new file mode 100644 index 000000000..74b2d5323 --- /dev/null +++ b/emswift/Makefile @@ -0,0 +1,6 @@ +# Copyright (c) 2015-2021, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 + +gosubdir := github.com/swiftstack/ProxyFS/emswift + +include ../GoMakefile diff --git a/emswift/dummy_test.go b/emswift/dummy_test.go new file mode 100644 index 000000000..d42991728 --- /dev/null +++ b/emswift/dummy_test.go @@ -0,0 +1,11 @@ +// Copyright (c) 2015-2021, NVIDIA CORPORATION. +// SPDX-License-Identifier: Apache-2.0 + +package main + +import ( + "testing" +) + +func TestDummy(t *testing.T) { +} diff --git a/emswift/emswift.conf b/emswift/emswift.conf new file mode 100644 index 000000000..7bbdf9f28 --- /dev/null +++ b/emswift/emswift.conf @@ -0,0 +1,15 @@ +# Copyright (c) 2015-2021, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 + +[EMSWIFT] +AuthIPAddr: # 0.0.0.0 +AuthTCPPort: # 8080 + +NoAuthIPAddr: 127.0.0.1 +NoAuthTCPPort: 8090 + +MaxAccountNameLength: 256 +MaxContainerNameLength: 256 +MaxObjectNameLength: 1024 +AccountListingLimit: 10000 +ContainerListingLimit: 10000 diff --git a/emswift/emswiftpkg/Makefile b/emswift/emswiftpkg/Makefile new file mode 100644 index 000000000..e40813d02 --- /dev/null +++ b/emswift/emswiftpkg/Makefile @@ -0,0 +1,6 @@ +# Copyright (c) 2015-2021, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 + +gosubdir := github.com/swiftstack/ProxyFS/emswift/emswiftpkg + +include ../../GoMakefile diff --git a/emswift/emswiftpkg/api.go b/emswift/emswiftpkg/api.go new file mode 100644 index 000000000..080d66b3b --- /dev/null +++ b/emswift/emswiftpkg/api.go @@ -0,0 +1,23 @@ +// Copyright (c) 2015-2021, NVIDIA CORPORATION. +// SPDX-License-Identifier: Apache-2.0 + +package emswiftpkg + +import ( + "github.com/swiftstack/ProxyFS/conf" +) + +// Start is called to start serving the NoAuth Swift Proxy Port and, +// optionally, the Auth Swift Proxy Port +// +func Start(confMap conf.ConfMap) (err error) { + err = start(confMap) + return +} + +// Stop is called to stop serving +// +func Stop() (err error) { + err = stop() + return +} diff --git a/emswift/emswiftpkg/dummy_test.go b/emswift/emswiftpkg/dummy_test.go new file mode 100644 index 000000000..7c7334abd --- /dev/null +++ b/emswift/emswiftpkg/dummy_test.go @@ -0,0 +1,11 @@ +// Copyright (c) 2015-2021, NVIDIA CORPORATION. +// SPDX-License-Identifier: Apache-2.0 + +package emswiftpkg + +import ( + "testing" +) + +func TestDummy(t *testing.T) { +} diff --git a/emswift/emswiftpkg/impl.go b/emswift/emswiftpkg/impl.go new file mode 100644 index 000000000..3ab3ea7d8 --- /dev/null +++ b/emswift/emswiftpkg/impl.go @@ -0,0 +1,1542 @@ +// Copyright (c) 2015-2021, NVIDIA CORPORATION. +// SPDX-License-Identifier: Apache-2.0 + +package emswiftpkg + +import ( + "fmt" + "io/ioutil" + "math/rand" + "net" + "net/http" + "strconv" + "strings" + "sync" + "syscall" + + "golang.org/x/sys/unix" + + "github.com/swiftstack/sortedmap" + + "github.com/swiftstack/ProxyFS/conf" + "github.com/swiftstack/ProxyFS/utils" +) + +type swiftAccountStruct struct { + name string + headers http.Header + swiftContainerTree sortedmap.LLRBTree // key is swiftContainerStruct.name; value is *swiftContainerStruct +} + +type swiftContainerStruct struct { + name string + swiftAccount *swiftAccountStruct // back-reference to swiftAccountStruct + headers http.Header + swiftObjectTree sortedmap.LLRBTree // key is swiftObjectStruct.name; value is *swiftObjectStruct +} + +type swiftObjectStruct struct { + name string + swiftContainer *swiftContainerStruct // back-reference to swiftContainerStruct + headers http.Header + contents []byte +} + +type configStruct struct { + AuthIPAddr string // Only required if Auth Swift Proxy enabled + AuthTCPPort uint16 // Only required if Auth Swift Proxy enabled + + NoAuthIPAddr string + NoAuthTCPPort uint16 + + MaxAccountNameLength uint64 + MaxContainerNameLength uint64 + MaxObjectNameLength uint64 + AccountListingLimit uint64 + ContainerListingLimit uint64 +} + +type authEmulatorStruct struct { + httpServer *http.Server + wg sync.WaitGroup +} + +type noAuthEmulatorStruct struct { + httpServer *http.Server + wg sync.WaitGroup +} + +type globalsStruct struct { + sync.Mutex + config configStruct + authEmulator *authEmulatorStruct + noAuthEmulator *noAuthEmulatorStruct + swiftAccountMap map[string]*swiftAccountStruct // key is swiftAccountStruct.name; value is *swiftAccountStruct +} + +var globals globalsStruct + +type httpRequestHandler struct{} + +type rangeStruct struct { + startOffset uint64 + stopOffset uint64 +} + +type stringSet map[string]bool + +var headerNameIgnoreSet = stringSet{"Accept": true, "Accept-Encoding": true, "User-Agent": true, "Content-Length": true} + +func start(confMap conf.ConfMap) (err error) { + err = initializeGlobals(confMap) + if nil != err { + return + } + + err = startNoAuth() + if nil != err { + return + } + + err = startAuthIfRequested() + if nil != err { + return + } + + return +} + +func stop() (err error) { + err = stopAuthIfRequested() + if nil != err { + return + } + + err = stopNoAuth() + if nil != err { + return + } + + uninitializeGlobals() + + err = nil + return +} + +func initializeGlobals(confMap conf.ConfMap) (err error) { + globals.config.AuthIPAddr, err = confMap.FetchOptionValueString("EMSWIFT", "AuthIPAddr") + if nil == err { + globals.config.AuthTCPPort, err = confMap.FetchOptionValueUint16("EMSWIFT", "AuthTCPPort") + if nil != err { + return + } + } else { + err = nil + globals.config.AuthIPAddr = "" + globals.config.AuthTCPPort = 0 + } + + globals.config.NoAuthIPAddr, err = confMap.FetchOptionValueString("EMSWIFT", "NoAuthIPAddr") + if nil != err { + return + } + globals.config.NoAuthTCPPort, err = confMap.FetchOptionValueUint16("EMSWIFT", "NoAuthTCPPort") + if nil != err { + return + } + + globals.config.MaxAccountNameLength, err = confMap.FetchOptionValueUint64("EMSWIFT", "MaxAccountNameLength") + if nil != err { + return + } + globals.config.MaxContainerNameLength, err = confMap.FetchOptionValueUint64("EMSWIFT", "MaxContainerNameLength") + if nil != err { + return + } + globals.config.MaxObjectNameLength, err = confMap.FetchOptionValueUint64("EMSWIFT", "MaxObjectNameLength") + if nil != err { + return + } + globals.config.AccountListingLimit, err = confMap.FetchOptionValueUint64("EMSWIFT", "AccountListingLimit") + if nil != err { + return + } + globals.config.ContainerListingLimit, err = confMap.FetchOptionValueUint64("EMSWIFT", "ContainerListingLimit") + if nil != err { + return + } + + globals.authEmulator = nil + globals.noAuthEmulator = nil + + globals.swiftAccountMap = make(map[string]*swiftAccountStruct) + + return +} + +func uninitializeGlobals() { + globals.config.AuthIPAddr = "" + globals.config.AuthTCPPort = 0 + + globals.config.NoAuthIPAddr = "" + globals.config.NoAuthTCPPort = 0 + + globals.config.MaxAccountNameLength = 0 + globals.config.MaxContainerNameLength = 0 + globals.config.MaxObjectNameLength = 0 + globals.config.AccountListingLimit = 0 + globals.config.ContainerListingLimit = 0 + + globals.authEmulator = nil + globals.noAuthEmulator = nil + + globals.swiftAccountMap = make(map[string]*swiftAccountStruct) +} + +func startAuthIfRequested() (err error) { + var ( + authEmulator *authEmulatorStruct + ) + + if "" == globals.config.AuthIPAddr { + globals.authEmulator = nil + err = nil + return + } + + authEmulator = &authEmulatorStruct{ + httpServer: &http.Server{ + Addr: net.JoinHostPort(globals.config.AuthIPAddr, fmt.Sprintf("%d", globals.config.AuthTCPPort)), + }, + } + authEmulator.httpServer.Handler = authEmulator + + authEmulator.wg.Add(1) + + globals.authEmulator = authEmulator + + go func() { + _ = globals.authEmulator.httpServer.ListenAndServe() + globals.authEmulator.wg.Done() + }() + + err = nil + return +} + +func stopAuthIfRequested() (err error) { + if nil == globals.authEmulator { + err = nil + return + } + + err = globals.authEmulator.httpServer.Close() + if nil != err { + return + } + + globals.authEmulator.wg.Wait() + + globals.authEmulator = nil + + return +} + +func startNoAuth() (err error) { + var ( + noAuthEmulator *noAuthEmulatorStruct + ) + + noAuthEmulator = &noAuthEmulatorStruct{ + httpServer: &http.Server{ + Addr: net.JoinHostPort(globals.config.NoAuthIPAddr, fmt.Sprintf("%d", globals.config.NoAuthTCPPort)), + }, + } + noAuthEmulator.httpServer.Handler = noAuthEmulator + + noAuthEmulator.wg.Add(1) + + globals.noAuthEmulator = noAuthEmulator + + go func() { + _ = globals.noAuthEmulator.httpServer.ListenAndServe() + globals.noAuthEmulator.wg.Done() + }() + + err = nil + return +} + +func stopNoAuth() (err error) { + err = globals.noAuthEmulator.httpServer.Close() + if nil != err { + return + } + + globals.noAuthEmulator.wg.Wait() + + globals.noAuthEmulator = nil + + return +} + +func (dummy *authEmulatorStruct) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) { + // TODO +} + +func (dummy *noAuthEmulatorStruct) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) { + // TODO +} + +func (dummy *globalsStruct) DumpKey(key sortedmap.Key) (keyAsString string, err error) { + keyAsString = fmt.Sprintf("%v", key) + err = nil + return +} + +func (dummy *globalsStruct) DumpValue(value sortedmap.Value) (valueAsString string, err error) { + valueAsString = fmt.Sprintf("%v", value) + err = nil + return +} + +func parsePath(request *http.Request) (infoOnly bool, swiftAccountName string, swiftContainerName string, swiftObjectName string) { + var ( + pathSplit []string + ) + + infoOnly = false + swiftAccountName = "" + swiftContainerName = "" + swiftObjectName = "" + + if "/info" == request.URL.Path { + infoOnly = true + return + } + + if strings.HasPrefix(request.URL.Path, "/v1/") { + pathSplit = strings.SplitN(request.URL.Path[4:], "/", 3) + swiftAccountName = pathSplit[0] + if 1 == len(pathSplit) { + swiftContainerName = "" + swiftObjectName = "" + } else { + swiftContainerName = pathSplit[1] + if 2 == len(pathSplit) { + swiftObjectName = "" + } else { + swiftObjectName = pathSplit[2] + } + } + } + + return +} + +func parseRangeHeader(request *http.Request, objectLen int) (ranges []rangeStruct, err error) { + var ( + off int + rangeHeaderValue string + rangeHeaderValueSuffix string + rangeString string + rangeStringSlice []string + rangesStrings []string + rangesStringsIndex int + startOffset int64 + stopOffset int64 + ) + + rangeHeaderValue = request.Header.Get("Range") + if "" == rangeHeaderValue { + ranges = make([]rangeStruct, 0) + err = nil + return + } + + if !strings.HasPrefix(rangeHeaderValue, "bytes=") { + err = fmt.Errorf("rangeHeaderValue (%v) does not start with expected \"bytes=\"", rangeHeaderValue) + return + } + + rangeHeaderValueSuffix = rangeHeaderValue[len("bytes="):] + + rangesStrings = strings.SplitN(rangeHeaderValueSuffix, ",", 2) + + ranges = make([]rangeStruct, len(rangesStrings)) + + for rangesStringsIndex, rangeString = range rangesStrings { + rangeStringSlice = strings.SplitN(rangeString, "-", 2) + if 2 != len(rangeStringSlice) { + err = fmt.Errorf("rangeHeaderValue (%v) malformed", rangeHeaderValue) + return + } + if "" == rangeStringSlice[0] { + startOffset = int64(-1) + } else { + off, err = strconv.Atoi(rangeStringSlice[0]) + if nil != err { + err = fmt.Errorf("rangeHeaderValue (%v) malformed (strconv.Atoi() failure: %v)", rangeHeaderValue, err) + return + } + startOffset = int64(off) + } + + if "" == rangeStringSlice[1] { + stopOffset = int64(-1) + } else { + off, err = strconv.Atoi(rangeStringSlice[1]) + if nil != err { + err = fmt.Errorf("rangeHeaderValue (%v) malformed (strconv.Atoi() failure: %v)", rangeHeaderValue, err) + return + } + stopOffset = int64(off) + } + + if ((0 > startOffset) && (0 > stopOffset)) || (startOffset > stopOffset) { + err = fmt.Errorf("rangeHeaderValue (%v) malformed", rangeHeaderValue) + return + } + + if startOffset < 0 { + startOffset = int64(objectLen) - stopOffset + if startOffset < 0 { + err = fmt.Errorf("rangeHeaderValue (%v) malformed...computed startOffset negative", rangeHeaderValue) + return + } + stopOffset = int64(objectLen - 1) + } else if stopOffset < 0 { + stopOffset = int64(objectLen - 1) + } else { + if stopOffset > int64(objectLen-1) { + stopOffset = int64(objectLen - 1) + } + } + + ranges[rangesStringsIndex].startOffset = uint64(startOffset) + ranges[rangesStringsIndex].stopOffset = uint64(stopOffset) + } + + err = nil + return +} + +func locateSwiftAccount(swiftAccountName string) (swiftAccount *swiftAccountStruct, errno syscall.Errno) { + var ( + ok bool + ) + + swiftAccount, ok = globals.swiftAccountMap[swiftAccountName] + if !ok { + errno = unix.ENOENT + return + } + errno = 0 + return +} + +func createSwiftAccount(swiftAccountName string) (swiftAccount *swiftAccountStruct, errno syscall.Errno) { + var ( + ok bool + ) + + _, ok = globals.swiftAccountMap[swiftAccountName] + if ok { + errno = unix.EEXIST + return + } + swiftAccount = &swiftAccountStruct{ + name: swiftAccountName, + headers: make(http.Header), + swiftContainerTree: sortedmap.NewLLRBTree(sortedmap.CompareString, &globals), + } + globals.swiftAccountMap[swiftAccountName] = swiftAccount + errno = 0 + return +} + +func createOrLocateSwiftAccount(swiftAccountName string) (swiftAccount *swiftAccountStruct, wasCreated bool) { + var ( + ok bool + ) + + swiftAccount, ok = globals.swiftAccountMap[swiftAccountName] + if ok { + wasCreated = false + } else { + swiftAccount = &swiftAccountStruct{ + name: swiftAccountName, + headers: make(http.Header), + swiftContainerTree: sortedmap.NewLLRBTree(sortedmap.CompareString, &globals), + } + globals.swiftAccountMap[swiftAccountName] = swiftAccount + wasCreated = true + } + return +} + +func deleteSwiftAccount(swiftAccountName string, force bool) (errno syscall.Errno) { + var ( + err error + ok bool + swiftAccount *swiftAccountStruct + swiftswiftAccountContainerCount int + ) + + swiftAccount, ok = globals.swiftAccountMap[swiftAccountName] + if ok { + if force { + // ok if account contains data... we'll forget it + } else { + swiftswiftAccountContainerCount, err = swiftAccount.swiftContainerTree.Len() + if nil != err { + panic(err) + } + if 0 != swiftswiftAccountContainerCount { + errno = unix.ENOTEMPTY + return + } + } + delete(globals.swiftAccountMap, swiftAccountName) + } else { + errno = unix.ENOENT + return + } + errno = 0 + return +} + +func locateSwiftContainer(swiftAccount *swiftAccountStruct, swiftContainerName string) (swiftContainer *swiftContainerStruct, errno syscall.Errno) { + var ( + err error + ok bool + swiftContainerAsValue sortedmap.Value + ) + + swiftContainerAsValue, ok, err = swiftAccount.swiftContainerTree.GetByKey(swiftContainerName) + if nil != err { + panic(err) + } + if ok { + swiftContainer = swiftContainerAsValue.(*swiftContainerStruct) + } else { + errno = unix.ENOENT + return + } + errno = 0 + return +} + +func createSwiftContainer(swiftAccount *swiftAccountStruct, swiftContainerName string) (swiftContainer *swiftContainerStruct, errno syscall.Errno) { + var ( + err error + ok bool + ) + + _, ok, err = swiftAccount.swiftContainerTree.GetByKey(swiftContainerName) + if nil != err { + panic(err) + } + if ok { + errno = unix.EEXIST + return + } else { + swiftContainer = &swiftContainerStruct{ + name: swiftContainerName, + swiftAccount: swiftAccount, + headers: make(http.Header), + swiftObjectTree: sortedmap.NewLLRBTree(sortedmap.CompareString, &globals), + } + _, err = swiftAccount.swiftContainerTree.Put(swiftContainerName, swiftContainer) + if nil != err { + panic(err) + } + } + errno = 0 + return +} + +func createOrLocateSwiftContainer(swiftAccount *swiftAccountStruct, swiftContainerName string) (swiftContainer *swiftContainerStruct, wasCreated bool) { + var ( + err error + ok bool + swiftContainerAsValue sortedmap.Value + ) + + swiftContainerAsValue, ok, err = swiftAccount.swiftContainerTree.GetByKey(swiftContainerName) + if nil != err { + panic(err) + } + if ok { + swiftContainer = swiftContainerAsValue.(*swiftContainerStruct) + wasCreated = false + } else { + swiftContainer = &swiftContainerStruct{ + name: swiftContainerName, + swiftAccount: swiftAccount, + headers: make(http.Header), + swiftObjectTree: sortedmap.NewLLRBTree(sortedmap.CompareString, &globals), + } + _, err = swiftAccount.swiftContainerTree.Put(swiftContainerName, swiftContainer) + if nil != err { + panic(err) + } + wasCreated = true + } + return +} + +func deleteSwiftContainer(swiftAccount *swiftAccountStruct, swiftContainerName string) (errno syscall.Errno) { + var ( + err error + ok bool + swiftContainer *swiftContainerStruct + swiftContainerAsValue sortedmap.Value + swiftContainerObjectCount int + ) + + swiftContainerAsValue, ok, err = swiftAccount.swiftContainerTree.GetByKey(swiftContainerName) + if nil != err { + panic(err) + } + if ok { + swiftContainer = swiftContainerAsValue.(*swiftContainerStruct) + swiftContainerObjectCount, err = swiftContainer.swiftObjectTree.Len() + if nil != err { + panic(err) + } + if 0 != swiftContainerObjectCount { + errno = unix.ENOTEMPTY + return + } + _, err = swiftAccount.swiftContainerTree.DeleteByKey(swiftContainerName) + if nil != err { + panic(err) + } + } else { + errno = unix.ENOENT + return + } + errno = 0 + return +} + +func locateSwiftObject(swiftContainer *swiftContainerStruct, swiftObjectName string) (swiftObject *swiftObjectStruct, errno syscall.Errno) { + var ( + err error + ok bool + swiftObjectAsValue sortedmap.Value + ) + + swiftObjectAsValue, ok, err = swiftContainer.swiftObjectTree.GetByKey(swiftObjectName) + if nil != err { + panic(err) + } + if ok { + swiftObject = swiftObjectAsValue.(*swiftObjectStruct) + } else { + errno = unix.ENOENT + return + } + errno = 0 + return +} + +func createSwiftObject(swiftContainer *swiftContainerStruct, swiftObjectName string) (swiftObject *swiftObjectStruct, errno syscall.Errno) { + var ( + err error + ok bool + ) + + _, ok, err = swiftContainer.swiftObjectTree.GetByKey(swiftObjectName) + if nil != err { + panic(err) + } + if ok { + errno = unix.EEXIST + return + } else { + swiftObject = &swiftObjectStruct{name: swiftObjectName, swiftContainer: swiftContainer, contents: []byte{}} + _, err = swiftContainer.swiftObjectTree.Put(swiftObjectName, swiftObject) + if nil != err { + panic(err) + } + } + errno = 0 + return +} + +func createOrLocateSwiftObject(swiftContainer *swiftContainerStruct, swiftObjectName string) (swiftObject *swiftObjectStruct, wasCreated bool) { + var ( + err error + ok bool + swiftObjectAsValue sortedmap.Value + ) + + swiftObjectAsValue, ok, err = swiftContainer.swiftObjectTree.GetByKey(swiftObjectName) + if nil != err { + panic(err) + } + if ok { + swiftObject = swiftObjectAsValue.(*swiftObjectStruct) + wasCreated = false + } else { + swiftObject = &swiftObjectStruct{name: swiftObjectName, swiftContainer: swiftContainer, contents: []byte{}} + _, err = swiftContainer.swiftObjectTree.Put(swiftObjectName, swiftObject) + if nil != err { + panic(err) + } + wasCreated = true + } + return +} + +func deleteSwiftObject(swiftContainer *swiftContainerStruct, swiftObjectName string) (errno syscall.Errno) { + var ( + err error + ok bool + ) + + _, ok, err = swiftContainer.swiftObjectTree.GetByKey(swiftObjectName) + if nil != err { + panic(err) + } + if ok { + _, err = swiftContainer.swiftObjectTree.DeleteByKey(swiftObjectName) + if nil != err { + panic(err) + } + } else { + errno = unix.ENOENT + return + } + errno = 0 + return +} + +func doNoAuthDELETE(responseWriter http.ResponseWriter, request *http.Request) { + var ( + err error + errno syscall.Errno + infoOnly bool + swiftAccount *swiftAccountStruct + swiftAccountName string + swiftContainer *swiftContainerStruct + swiftContainerName string + swiftObjectName string + ) + + infoOnly, swiftAccountName, swiftContainerName, swiftObjectName = parsePath(request) + if infoOnly || ("" == swiftAccountName) { + responseWriter.WriteHeader(http.StatusForbidden) + } else { + if "" == swiftContainerName { + // DELETE SwiftAccount + errno = deleteSwiftAccount(swiftAccountName, false) + switch errno { + case 0: + responseWriter.WriteHeader(http.StatusNoContent) + case unix.ENOENT: + responseWriter.WriteHeader(http.StatusNotFound) + case unix.ENOTEMPTY: + responseWriter.WriteHeader(http.StatusConflict) + default: + err = fmt.Errorf("deleteSwiftAccount(\"%v\", false) returned unexpected errno: %v", swiftAccountName, errno) + panic(err) + } + } else { + // DELETE SwiftContainer or SwiftObject + swiftAccount, errno = locateSwiftAccount(swiftAccountName) + switch errno { + case 0: + if "" == swiftObjectName { + // DELETE SwiftContainer + errno = deleteSwiftContainer(swiftAccount, swiftContainerName) + switch errno { + case 0: + responseWriter.WriteHeader(http.StatusNoContent) + case unix.ENOENT: + responseWriter.WriteHeader(http.StatusNotFound) + case unix.ENOTEMPTY: + responseWriter.WriteHeader(http.StatusConflict) + default: + err = fmt.Errorf("deleteSwiftContainer(\"%v\") returned unexpected errno: %v", swiftContainerName, errno) + panic(err) + } + } else { + // DELETE SwiftObject + swiftContainer, errno = locateSwiftContainer(swiftAccount, swiftContainerName) + switch errno { + case 0: + errno = deleteSwiftObject(swiftContainer, swiftObjectName) + switch errno { + case 0: + responseWriter.WriteHeader(http.StatusNoContent) + case unix.ENOENT: + responseWriter.WriteHeader(http.StatusNotFound) + default: + err = fmt.Errorf("deleteSwiftObject(\"%v\") returned unexpected errno: %v", swiftObjectName, errno) + panic(err) + } + case unix.ENOENT: + responseWriter.WriteHeader(http.StatusNotFound) + default: + err = fmt.Errorf("locateSwiftContainer(\"%v\") returned unexpected errno: %v", swiftContainerName, errno) + panic(err) + } + } + case unix.ENOENT: + responseWriter.WriteHeader(http.StatusNotFound) + default: + err = fmt.Errorf("locateSwiftAccount(\"%v\") returned unexpected errno: %v", swiftAccountName, errno) + panic(err) + } + } + } +} + +func doNoAuthGET(responseWriter http.ResponseWriter, request *http.Request) { + var ( + boundaryString string + containerIndex int + containerIndexLimit int + err error + errno syscall.Errno + found bool + headerName string + headerValue string + headerValueSlice []string + infoOnly bool + marker string + markerSlice []string + objectIndex int + objectIndexLimit int + ok bool + numContainers int + numObjects int + ranges []rangeStruct + rS rangeStruct + swiftAccount *swiftAccountStruct + swiftAccountName string + swiftContainer *swiftContainerStruct + swiftContainerName string + swiftContainerNameAsKey sortedmap.Key + swiftObject *swiftObjectStruct + swiftObjectName string + swiftObjectNameAsKey sortedmap.Key + ) + + infoOnly, swiftAccountName, swiftContainerName, swiftObjectName = parsePath(request) + if infoOnly { + _, _ = responseWriter.Write(utils.StringToByteSlice("{")) + _, _ = responseWriter.Write(utils.StringToByteSlice("\"swift\": {")) + _, _ = responseWriter.Write(utils.StringToByteSlice("\"max_account_name_length\": " + strconv.Itoa(int(globals.config.MaxAccountNameLength)) + ",")) + _, _ = responseWriter.Write(utils.StringToByteSlice("\"max_container_name_length\": " + strconv.Itoa(int(globals.config.MaxContainerNameLength)) + ",")) + _, _ = responseWriter.Write(utils.StringToByteSlice("\"max_object_name_length\": " + strconv.Itoa(int(globals.config.MaxObjectNameLength)) + ",")) + _, _ = responseWriter.Write(utils.StringToByteSlice("\"account_listing_limit\": " + strconv.Itoa(int(globals.config.AccountListingLimit)) + ",")) + _, _ = responseWriter.Write(utils.StringToByteSlice("\"container_listing_limit\": " + strconv.Itoa(int(globals.config.ContainerListingLimit)))) + _, _ = responseWriter.Write(utils.StringToByteSlice("}")) + _, _ = responseWriter.Write(utils.StringToByteSlice("}")) + } else { + if "" == swiftAccountName { + responseWriter.WriteHeader(http.StatusForbidden) + } else { + swiftAccount, errno = locateSwiftAccount(swiftAccountName) + switch errno { + case 0: + if "" == swiftContainerName { + // GET SwiftAccount + for headerName, headerValueSlice = range swiftAccount.headers { + for _, headerValue = range headerValueSlice { + responseWriter.Header().Add(headerName, headerValue) + } + } + numContainers, err = swiftAccount.swiftContainerTree.Len() + if nil != err { + panic(err) + } + if 0 == numContainers { + responseWriter.WriteHeader(http.StatusNoContent) + } else { + marker = "" + markerSlice, ok = request.URL.Query()["marker"] + if ok && (0 < len(markerSlice)) { + marker = markerSlice[0] + } + containerIndex, found, err = swiftAccount.swiftContainerTree.BisectRight(marker) + if nil != err { + panic(err) + } + if found { + containerIndex++ + } + if containerIndex < numContainers { + containerIndexLimit = numContainers + if (containerIndexLimit - containerIndex) > int(globals.config.AccountListingLimit) { + containerIndexLimit = containerIndex + int(globals.config.AccountListingLimit) + } + for containerIndex < containerIndexLimit { + swiftContainerNameAsKey, _, _, err = swiftAccount.swiftContainerTree.GetByIndex(containerIndex) + if nil != err { + panic(err) + } + swiftContainerName = swiftContainerNameAsKey.(string) + _, _ = responseWriter.Write(utils.StringToByteSlice(swiftContainerName)) + _, _ = responseWriter.Write([]byte{'\n'}) + containerIndex++ + } + } else { + responseWriter.WriteHeader(http.StatusNoContent) + } + } + } else { + // GET SwiftContainer or SwiftObject + swiftContainer, errno = locateSwiftContainer(swiftAccount, swiftContainerName) + switch errno { + case 0: + if "" == swiftObjectName { + // GET SwiftContainer + for headerName, headerValueSlice = range swiftContainer.headers { + for _, headerValue = range headerValueSlice { + responseWriter.Header().Add(headerName, headerValue) + } + } + numObjects, err = swiftContainer.swiftObjectTree.Len() + if nil != err { + panic(err) + } + if 0 == numObjects { + responseWriter.WriteHeader(http.StatusNoContent) + } else { + marker = "" + markerSlice, ok = request.URL.Query()["marker"] + if ok && (0 < len(markerSlice)) { + marker = markerSlice[0] + } + objectIndex, found, err = swiftContainer.swiftObjectTree.BisectRight(marker) + if nil != err { + panic(err) + } + if found { + objectIndex++ + } + if objectIndex < numObjects { + objectIndexLimit = numObjects + if (objectIndexLimit - objectIndex) > int(globals.config.ContainerListingLimit) { + objectIndexLimit = objectIndex + int(globals.config.ContainerListingLimit) + } + for objectIndex < objectIndexLimit { + swiftObjectNameAsKey, _, _, err = swiftContainer.swiftObjectTree.GetByIndex(objectIndex) + if nil != err { + panic(err) + } + swiftObjectName = swiftObjectNameAsKey.(string) + _, _ = responseWriter.Write(utils.StringToByteSlice(swiftObjectName)) + _, _ = responseWriter.Write([]byte{'\n'}) + objectIndex++ + } + } else { + responseWriter.WriteHeader(http.StatusNoContent) + } + } + } else { + // GET SwiftObject + swiftObject, errno = locateSwiftObject(swiftContainer, swiftObjectName) + switch errno { + case 0: + for headerName, headerValueSlice = range swiftObject.headers { + for _, headerValue = range headerValueSlice { + responseWriter.Header().Add(headerName, headerValue) + } + } + ranges, err = parseRangeHeader(request, len(swiftObject.contents)) + if nil == err { + switch len(ranges) { + case 0: + responseWriter.Header().Add("Content-Type", "application/octet-stream") + responseWriter.WriteHeader(http.StatusOK) + _, _ = responseWriter.Write(swiftObject.contents) + case 1: + responseWriter.Header().Add("Content-Type", "application/octet-stream") + responseWriter.Header().Add("Content-Range", fmt.Sprintf("bytes %d-%d/%d", ranges[0].startOffset, ranges[0].stopOffset, len(swiftObject.contents))) + responseWriter.WriteHeader(http.StatusPartialContent) + _, _ = responseWriter.Write(swiftObject.contents[ranges[0].startOffset:(ranges[0].stopOffset + 1)]) + default: + boundaryString = fmt.Sprintf("%016x%016x", rand.Uint64(), rand.Uint64()) + responseWriter.Header().Add("Content-Type", fmt.Sprintf("multipart/byteranges; boundary=%v", boundaryString)) + responseWriter.WriteHeader(http.StatusPartialContent) + for _, rS = range ranges { + _, _ = responseWriter.Write([]byte("--" + boundaryString + "\r\n")) + _, _ = responseWriter.Write([]byte("Content-Type: application/octet-stream\r\n")) + _, _ = responseWriter.Write([]byte(fmt.Sprintf("Content-Range: bytes %d-%d/%d\r\n", rS.startOffset, rS.stopOffset, len(swiftObject.contents)))) + _, _ = responseWriter.Write([]byte("\r\n")) + _, _ = responseWriter.Write(swiftObject.contents[rS.startOffset:(rS.stopOffset + 1)]) + _, _ = responseWriter.Write([]byte("\r\n")) + } + _, _ = responseWriter.Write([]byte("--" + boundaryString + "--")) + } + } else { + responseWriter.WriteHeader(http.StatusBadRequest) + } + case unix.ENOENT: + responseWriter.WriteHeader(http.StatusNotFound) + default: + err = fmt.Errorf("locateSwiftObject(\"%v\") returned unexpected errno: %v", swiftObjectName, errno) + panic(err) + } + } + case unix.ENOENT: + responseWriter.WriteHeader(http.StatusNotFound) + default: + err = fmt.Errorf("locateSwiftContainer(\"%v\") returned unexpected errno: %v", swiftContainerName, errno) + panic(err) + } + } + case unix.ENOENT: + responseWriter.WriteHeader(http.StatusNotFound) + default: + err = fmt.Errorf("locateSwiftAccount(\"%v\") returned unexpected errno: %v", swiftAccountName, errno) + panic(err) + } + } + } +} + +func doNoAuthHEAD(responseWriter http.ResponseWriter, request *http.Request) { + var ( + err error + errno syscall.Errno + headerName string + headerValue string + headerValueSlice []string + infoOnly bool + swiftAccount *swiftAccountStruct + swiftAccountName string + swiftContainer *swiftContainerStruct + swiftContainerName string + swiftObject *swiftObjectStruct + swiftObjectName string + ) + + infoOnly, swiftAccountName, swiftContainerName, swiftObjectName = parsePath(request) + if infoOnly || ("" == swiftAccountName) { + responseWriter.WriteHeader(http.StatusForbidden) + } else { + swiftAccount, errno = locateSwiftAccount(swiftAccountName) + switch errno { + case 0: + if "" == swiftContainerName { + // HEAD SwiftAccount + for headerName, headerValueSlice = range swiftAccount.headers { + for _, headerValue = range headerValueSlice { + responseWriter.Header().Add(headerName, headerValue) + } + } + responseWriter.WriteHeader(http.StatusNoContent) + } else { + // HEAD SwiftContainer or SwiftObject + swiftContainer, errno = locateSwiftContainer(swiftAccount, swiftContainerName) + switch errno { + case 0: + if "" == swiftObjectName { + // HEAD SwiftContainer + for headerName, headerValueSlice = range swiftContainer.headers { + for _, headerValue = range headerValueSlice { + responseWriter.Header().Add(headerName, headerValue) + } + } + responseWriter.WriteHeader(http.StatusNoContent) + } else { + // HEAD SwiftObject + swiftObject, errno = locateSwiftObject(swiftContainer, swiftObjectName) + switch errno { + case 0: + for headerName, headerValueSlice = range swiftObject.headers { + for _, headerValue = range headerValueSlice { + responseWriter.Header().Add(headerName, headerValue) + } + } + responseWriter.Header().Set("Content-Length", strconv.Itoa(len(swiftObject.contents))) + responseWriter.WriteHeader(http.StatusOK) + case unix.ENOENT: + responseWriter.WriteHeader(http.StatusNotFound) + default: + err = fmt.Errorf("locateSwiftObject(\"%v\") returned unexpected errno: %v", swiftObjectName, errno) + panic(err) + } + } + case unix.ENOENT: + responseWriter.WriteHeader(http.StatusNotFound) + default: + err = fmt.Errorf("locateSwiftContainer(\"%v\") returned unexpected errno: %v", swiftContainerName, errno) + panic(err) + } + } + case unix.ENOENT: + responseWriter.WriteHeader(http.StatusNotFound) + default: + err = fmt.Errorf("locateSwiftAccount(\"%v\") returned unexpected errno: %v", swiftAccountName, errno) + panic(err) + } + } +} + +func doNoAuthPOST(responseWriter http.ResponseWriter, request *http.Request) { + var ( + err error + errno syscall.Errno + headerName string + headerValue string + headerValueSlice []string + headerValueSliceLen int + ignoreHeader bool + infoOnly bool + swiftAccount *swiftAccountStruct + swiftAccountName string + swiftContainer *swiftContainerStruct + swiftContainerName string + swiftObject *swiftObjectStruct + swiftObjectName string + ) + + infoOnly, swiftAccountName, swiftContainerName, swiftObjectName = parsePath(request) + if infoOnly || ("" == swiftAccountName) { + responseWriter.WriteHeader(http.StatusForbidden) + } else { + swiftAccount, errno = locateSwiftAccount(swiftAccountName) + switch errno { + case 0: + if "" == swiftContainerName { + // POST SwiftAccount + for headerName, headerValueSlice = range request.Header { + _, ignoreHeader = headerNameIgnoreSet[headerName] + if !ignoreHeader { + headerValueSliceLen = len(headerValueSlice) + if 0 < headerValueSliceLen { + swiftAccount.headers[headerName] = make([]string, 0, headerValueSliceLen) + for _, headerValue = range headerValueSlice { + if 0 < len(headerValue) { + swiftAccount.headers[headerName] = append(swiftAccount.headers[headerName], headerValue) + } + } + if 0 == len(swiftAccount.headers[headerName]) { + delete(swiftAccount.headers, headerName) + } + } + } + } + responseWriter.WriteHeader(http.StatusNoContent) + } else { + // POST SwiftContainer or SwiftObject + swiftContainer, errno = locateSwiftContainer(swiftAccount, swiftContainerName) + switch errno { + case 0: + if "" == swiftObjectName { + // POST SwiftContainer + for headerName, headerValueSlice = range request.Header { + _, ignoreHeader = headerNameIgnoreSet[headerName] + if !ignoreHeader { + headerValueSliceLen = len(headerValueSlice) + if 0 < headerValueSliceLen { + swiftContainer.headers[headerName] = make([]string, 0, headerValueSliceLen) + for _, headerValue = range headerValueSlice { + if 0 < len(headerValue) { + swiftContainer.headers[headerName] = append(swiftContainer.headers[headerName], headerValue) + } + } + if 0 == len(swiftContainer.headers[headerName]) { + delete(swiftContainer.headers, headerName) + } + } + } + } + responseWriter.WriteHeader(http.StatusNoContent) + } else { + // POST SwiftObject + swiftObject, errno = locateSwiftObject(swiftContainer, swiftObjectName) + switch errno { + case 0: + for headerName, headerValueSlice = range request.Header { + _, ignoreHeader = headerNameIgnoreSet[headerName] + if !ignoreHeader { + headerValueSliceLen = len(headerValueSlice) + if 0 < headerValueSliceLen { + swiftObject.headers[headerName] = make([]string, 0, headerValueSliceLen) + for _, headerValue = range headerValueSlice { + if 0 < len(headerValue) { + swiftObject.headers[headerName] = append(swiftObject.headers[headerName], headerValue) + } + } + if 0 == len(swiftObject.headers[headerName]) { + delete(swiftObject.headers, headerName) + } + } + } + } + responseWriter.WriteHeader(http.StatusNoContent) + case unix.ENOENT: + responseWriter.WriteHeader(http.StatusNotFound) + default: + err = fmt.Errorf("locateSwiftObject(\"%v\") returned unexpected errno: %v", swiftObjectName, errno) + panic(err) + } + } + case unix.ENOENT: + responseWriter.WriteHeader(http.StatusNotFound) + default: + err = fmt.Errorf("locateSwiftContainer(\"%v\") returned unexpected errno: %v", swiftContainerName, errno) + panic(err) + } + } + case unix.ENOENT: + responseWriter.WriteHeader(http.StatusNotFound) + default: + err = fmt.Errorf("locateSwiftAccount(\"%v\") returned unexpected errno: %v", swiftAccountName, errno) + panic(err) + } + } +} + +func doNoAuthPUT(responseWriter http.ResponseWriter, request *http.Request) { + var ( + err error + errno syscall.Errno + headerName string + headerValue string + headerValueSlice []string + headerValueSliceLen int + ignoreHeader bool + infoOnly bool + swiftAccount *swiftAccountStruct + swiftAccountName string + swiftContainer *swiftContainerStruct + swiftContainerName string + swiftObject *swiftObjectStruct + swiftObjectName string + wasCreated bool + ) + + infoOnly, swiftAccountName, swiftContainerName, swiftObjectName = parsePath(request) + if infoOnly || ("" == swiftAccountName) { + responseWriter.WriteHeader(http.StatusForbidden) + } else { + if "" == swiftContainerName { + // PUT SwiftAccount + swiftAccount, wasCreated = createOrLocateSwiftAccount(swiftAccountName) + if wasCreated { + swiftAccount.headers = make(http.Header) + } + for headerName, headerValueSlice = range request.Header { + _, ignoreHeader = headerNameIgnoreSet[headerName] + if !ignoreHeader { + headerValueSliceLen = len(headerValueSlice) + if 0 < headerValueSliceLen { + swiftAccount.headers[headerName] = make([]string, 0, headerValueSliceLen) + for _, headerValue = range headerValueSlice { + if 0 < len(headerValue) { + swiftAccount.headers[headerName] = append(swiftAccount.headers[headerName], headerValue) + } + } + if 0 == len(swiftAccount.headers[headerName]) { + delete(swiftAccount.headers, headerName) + } + } + } + } + if wasCreated { + responseWriter.WriteHeader(http.StatusCreated) + } else { + responseWriter.WriteHeader(http.StatusAccepted) + } + } else { + // PUT SwiftContainer or SwiftObject + swiftAccount, errno = locateSwiftAccount(swiftAccountName) + switch errno { + case 0: + if "" == swiftObjectName { + // PUT SwiftContainer + swiftContainer, wasCreated = createOrLocateSwiftContainer(swiftAccount, swiftContainerName) + if wasCreated { + swiftContainer.headers = make(http.Header) + } + for headerName, headerValueSlice = range request.Header { + _, ignoreHeader = headerNameIgnoreSet[headerName] + if !ignoreHeader { + headerValueSliceLen = len(headerValueSlice) + if 0 < headerValueSliceLen { + swiftContainer.headers[headerName] = make([]string, 0, headerValueSliceLen) + for _, headerValue = range headerValueSlice { + if 0 < len(headerValue) { + swiftContainer.headers[headerName] = append(swiftContainer.headers[headerName], headerValue) + } + } + if 0 == len(swiftContainer.headers[headerName]) { + delete(swiftContainer.headers, headerName) + } + } + } + } + if wasCreated { + responseWriter.WriteHeader(http.StatusCreated) + } else { + responseWriter.WriteHeader(http.StatusAccepted) + } + } else { + // PUT SwiftObject + swiftContainer, errno = locateSwiftContainer(swiftAccount, swiftContainerName) + switch errno { + case 0: + swiftObject, wasCreated = createOrLocateSwiftObject(swiftContainer, swiftObjectName) + if wasCreated { + swiftObject.headers = make(http.Header) + } + for headerName, headerValueSlice = range request.Header { + _, ignoreHeader = headerNameIgnoreSet[headerName] + if !ignoreHeader { + headerValueSliceLen = len(headerValueSlice) + if 0 < headerValueSliceLen { + swiftObject.headers[headerName] = make([]string, 0, headerValueSliceLen) + for _, headerValue = range headerValueSlice { + if 0 < len(headerValue) { + swiftObject.headers[headerName] = append(swiftObject.headers[headerName], headerValue) + } + } + if 0 == len(swiftObject.headers[headerName]) { + delete(swiftObject.headers, headerName) + } + } + } + } + swiftObject.contents, _ = ioutil.ReadAll(request.Body) + if wasCreated { + responseWriter.WriteHeader(http.StatusCreated) + } else { + responseWriter.WriteHeader(http.StatusCreated) + } + case unix.ENOENT: + responseWriter.WriteHeader(http.StatusForbidden) + default: + err = fmt.Errorf("locateSwiftContainer(\"%v\") returned unexpected errno: %v", swiftContainerName, errno) + panic(err) + } + } + case unix.ENOENT: + responseWriter.WriteHeader(http.StatusForbidden) + default: + err = fmt.Errorf("locateSwiftAccount(\"%v\") returned unexpected errno: %v", swiftAccountName, errno) + panic(err) + } + } + } +} + +/* +func (h httpRequestHandler) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) { + switch request.Method { + case http.MethodDelete: + doNoAuthDELETE(responseWriter, request) + case http.MethodGet: + doNoAuthGET(responseWriter, request) + case http.MethodHead: + doNoAuthHEAD(responseWriter, request) + case http.MethodPost: + doNoAuthPOST(responseWriter, request) + case http.MethodPut: + doNoAuthPUT(responseWriter, request) + default: + responseWriter.WriteHeader(http.StatusMethodNotAllowed) + } +} + +func setupNoAuthSwift(confMap conf.ConfMap) { + var ( + err error + errno syscall.Errno + primaryPeerList []string + swiftAccountName string + volumeGroupNameList []string + volumeGroupName string + volumeGroupSectionName string + volumeName string + volumeNameList []string + volumeSectionName string + ) + + // Fetch and configure volumes for which "we" are the PrimaryPeer + + volumeGroupNameList, err = confMap.FetchOptionValueStringSlice("FSGlobals", "VolumeGroupList") + if nil != err { + log.Fatalf("failed fetch of FSGlobals.VolumeGroupList: %v", err) + } + + for _, volumeGroupName = range volumeGroupNameList { + volumeGroupSectionName = "VolumeGroup:" + volumeGroupName + + primaryPeerList, err = confMap.FetchOptionValueStringSlice(volumeGroupSectionName, "PrimaryPeer") + if nil != err { + log.Fatalf("failed fetch of %v.PrimaryPeer: %v", volumeGroupSectionName, err) + } + if 0 == len(primaryPeerList) { + continue + } else if 1 == len(primaryPeerList) { + if globals.whoAmI != primaryPeerList[0] { + continue + } + } else { + log.Fatalf("fetch of %v.PrimaryPeer returned multiple values", volumeGroupSectionName) + } + + volumeNameList, err = confMap.FetchOptionValueStringSlice(volumeGroupSectionName, "VolumeList") + if nil != err { + log.Fatalf("failed fetch of %v.VolumeList: %v", volumeGroupSectionName, err) + } + + for _, volumeName = range volumeNameList { + volumeSectionName = "Volume:" + volumeName + + swiftAccountName, err = confMap.FetchOptionValueString(volumeSectionName, "AccountName") + if nil != err { + log.Fatalf("failed fetch of %v.AccountName: %v", volumeSectionName, err) + } + + _, errno = createSwiftAccount(swiftAccountName) + if 0 != errno { + log.Fatalf("failed create of %v: %v", swiftAccountName, err) + } + } + } + + // Create HTTP Server on the requested noAuthTCPPort + + globals.noAuthHTTPServer = &http.Server{ + Addr: globals.noAuthAddr, + Handler: httpRequestHandler{}, + } +} + +func serveNoAuthSwift() { + _ = globals.noAuthHTTPServer.ListenAndServe() + + globals.noAuthHTTPServerWG.Done() +} + +func Daemon(confFile string, confStrings []string, signalHandlerIsArmedWG *sync.WaitGroup, doneChan chan bool, signals ...os.Signal) { + var ( + confMap conf.ConfMap + err error + resp *http.Response + signalChan chan os.Signal + signalReceived os.Signal + ) + + // Initialization + + globals = &globalsStruct{} + + globals.swiftAccountMap = make(map[string]*swiftAccountStruct) + + // Compute confMap + + confMap, err = conf.MakeConfMapFromFile(confFile) + if nil != err { + log.Fatalf("failed to load config: %v", err) + } + + err = confMap.UpdateFromStrings(confStrings) + if nil != err { + log.Fatalf("failed to apply config overrides: %v", err) + } + + err = transitions.UpgradeConfMapIfNeeded(confMap) + if nil != err { + log.Fatalf("failed to upgrade confMap: %v", err) + } + + // Find out who "we" are + + globals.whoAmI, err = confMap.FetchOptionValueString("Cluster", "WhoAmI") + if nil != err { + log.Fatalf("failed fetch of Cluster.WhoAmI: %v", err) + } + + globals.noAuthTCPPort, err = confMap.FetchOptionValueUint16("SwiftClient", "NoAuthTCPPort") + if nil != err { + log.Fatalf("failed fetch of Swift.NoAuthTCPPort: %v", err) + } + + globals.noAuthAddr = "127.0.0.1:" + strconv.Itoa(int(globals.noAuthTCPPort)) + + // Kick off NoAuth Swift Proxy Emulator + + setupNoAuthSwift(confMap) + globals.noAuthHTTPServerWG.Add(1) + go serveNoAuthSwift() + + // Wait for serveNoAuthSwift() to begin serving + + for { + resp, err = http.Get("http://" + globals.noAuthAddr + "/info") + if nil != err { + log.Printf("failed GET of \"/info\": %v", err) + continue + } + if http.StatusOK == resp.StatusCode { + break + } + log.Printf("GET of \"/info\" returned Status %v", resp.Status) + time.Sleep(100 * time.Millisecond) + } + + // Arm signal handler used to indicate termination and wait on it + // + // Note: signalled chan must be buffered to avoid race with window between + // arming handler and blocking on the chan read + + signalChan = make(chan os.Signal, 1) + + signal.Notify(signalChan, signals...) + + if nil != signalHandlerIsArmedWG { + signalHandlerIsArmedWG.Done() + } + + // Await a signal - reloading confFile each SIGHUP - exiting otherwise + + for { + signalReceived = <-signalChan + + if unix.SIGHUP == signalReceived { + // recompute confMap and re-apply + + confMap, err = conf.MakeConfMapFromFile(confFile) + if nil != err { + log.Fatalf("failed to load updated config: %v", err) + } + + err = confMap.UpdateFromStrings(confStrings) + if nil != err { + log.Fatalf("failed to reapply config overrides: %v", err) + } + + err = transitions.UpgradeConfMapIfNeeded(confMap) + if nil != err { + log.Fatalf("failed to upgrade confMap: %v", err) + } + + updateConf(confMap) + } else { + // signalReceived either SIGINT or SIGTERM... so just exit + + err = globals.noAuthHTTPServer.Close() + + globals.noAuthHTTPServerWG.Wait() + + globals = nil + + doneChan <- true + + return + } + } +} +*/ diff --git a/emswift/emswiftpkg/setup_teardown_test.go_HIDE b/emswift/emswiftpkg/setup_teardown_test.go_HIDE new file mode 100644 index 000000000..5aa1e5b84 --- /dev/null +++ b/emswift/emswiftpkg/setup_teardown_test.go_HIDE @@ -0,0 +1,369 @@ +// Copyright (c) 2015-2021, NVIDIA CORPORATION. +// SPDX-License-Identifier: Apache-2.0 + +package emswiftpkg + +import ( + "io/ioutil" + "net/http" + "os" + "strconv" + "sync" + "testing" + "time" + + "golang.org/x/sys/unix" + + "github.com/swiftstack/ProxyFS/conf" + "github.com/swiftstack/ProxyFS/proxyfsd" + "github.com/swiftstack/ProxyFS/ramswift" +) + +const ( + testAccountName = "AUTH_test" + testAuthKey = "testing" + testAuthUser = "test:tester" + testDaemonStartPollInterval = 1 * time.Second + testProxyFSDaemonHTTPPort = "15347" + testProxyFSDaemonIPAddr = "127.0.0.1" + testSwiftNoAuthIPAddr = "127.0.0.1" + testSwiftNoAuthPort = "38090" + testSwiftProxyAddr = "localhost:38080" +) + +type testDaemonGlobalsStruct struct { + proxyfsdErrChan chan error + proxyfsdWG sync.WaitGroup + ramswiftDoneChan chan bool +} + +var testDaemonGlobals testDaemonGlobalsStruct + +func testSetup(t *testing.T) { + var ( + err error + infoResponse *http.Response + ramswiftSignalHandlerIsArmedWG sync.WaitGroup + testConfMap conf.ConfMap + testConfStrings []string + testDir string + testPlugInEnvValue string + versionResponse *http.Response + ) + + testDir, err = ioutil.TempDir(os.TempDir(), "pfsagentd_test_") + if nil != err { + t.Fatalf("ioutil.TempDir() failed: %v", err) + } + + err = os.Chdir(testDir) + if nil != err { + t.Fatalf("os.Chdir() failed: %v", err) + } + + err = os.Mkdir("ProxyFSMountPointPath", 0777) // Agent.FUSEMountPointPath + if nil != err { + t.Fatalf("os.Mkdir() failed: %v", err) + } + + err = os.Mkdir("PfsAgentMountPointPath", 0777) // Volume:CommonVolume.FUSEMountPointName + if nil != err { + t.Fatalf("os.Mkdir() failed: %v", err) + } + + testPlugInEnvValue = "{\"AuthURL\":\"http://" + testPlugInEnvValue += testSwiftProxyAddr + testPlugInEnvValue += "/auth/v1.0\"\\u002C\"AuthUser\":\"" + testPlugInEnvValue += testAuthUser + testPlugInEnvValue += "\"\\u002C\"AuthKey\":\"" + testPlugInEnvValue += testAuthKey + testPlugInEnvValue += "\"\\u002C\"Account\":\"" + testPlugInEnvValue += testAccountName + testPlugInEnvValue += "\"}" + + testConfStrings = []string{ + "Agent.FUSEVolumeName=CommonVolume", + "Agent.FUSEMountPointPath=PfsAgentMountPointPath", + "Agent.FUSEUnMountRetryDelay=100ms", + "Agent.FUSEUnMountRetryCap=100", + "Agent.PlugInPath=/dev/null", // Using hard-coded AUTH + "Agent.PlugInEnvName=SwiftAuthBlob", + "Agent.PlugInEnvValue=" + testPlugInEnvValue, + "Agent.SwiftTimeout=20s", + "Agent.SwiftRetryLimit=10", + "Agent.SwiftRetryDelay=10ms", + "Agent.SwiftRetryDelayVariance=25", + "Agent.SwiftRetryExpBackoff=1.4", + "Agent.SwiftConnectionPoolSize=200", + "Agent.FetchExtentsFromFileOffset=32", + "Agent.FetchExtentsBeforeFileOffset=0", + "Agent.ReadCacheLineSize=1048576", + "Agent.ReadCacheLineCount=1000", + "Agent.LeaseRetryLimit=10", + "Agent.LeaseRetryDelay=10ms", + "Agent.LeaseRetryDelayVariance=25", + "Agent.LeaseRetryExpBackoff=1.4", + "Agent.SharedLeaseLimit=1000", + "Agent.ExclusiveLeaseLimit=100", + "Agent.ExtentMapEntryLimit=1048576", + "Agent.DirtyLogSegmentLimit=50", + "Agent.DirtyFileLimit=50", // TODO - obsolete this + "Agent.MaxFlushSize=10485760", + "Agent.MaxFlushTime=10s", + "Agent.LogFilePath=", + "Agent.LogToConsole=false", + "Agent.TraceEnabled=false", + "Agent.HTTPServerIPAddr=127.0.0.1", + "Agent.HTTPServerTCPPort=54323", + "Agent.ReadDirPlusEnabled=false", + "Agent.XAttrEnabled=false", + "Agent.EntryDuration=10s", + "Agent.AttrDuration=10s", + "Agent.AttrBlockSize=65536", + "Agent.ReaddirMaxEntries=1024", + "Agent.FUSEMaxBackground=100", + "Agent.FUSECongestionThreshhold=0", + "Agent.FUSEMaxWrite=131072", // Linux max... 128KiB is good enough for testing + "Agent.RetryRPCDeadlineIO=60s", + "Agent.RetryRPCKeepAlivePeriod=60s", + + "Stats.IPAddr=localhost", + "Stats.UDPPort=54324", + "Stats.BufferLength=100", + "Stats.MaxLatency=1s", + + "StatsLogger.Period=0m", + "StatsLogger.Verbose=false", + + "Logging.LogFilePath=/dev/null", + "Logging.LogToConsole=false", + + "Peer:Peer0.PublicIPAddr=" + testProxyFSDaemonIPAddr, + "Peer:Peer0.PrivateIPAddr=" + testProxyFSDaemonIPAddr, + "Peer:Peer0.ReadCacheQuotaFraction=0.20", + + "Cluster.WhoAmI=Peer0", + "Cluster.Peers=Peer0", + "Cluster.ServerGuid=a66488e9-a051-4ff7-865d-87bfb84cc2ae", + "Cluster.PrivateClusterUDPPort=54325", + "Cluster.UDPPacketSendSize=1400", + "Cluster.UDPPacketRecvSize=1500", + "Cluster.UDPPacketCapPerMessage=5", + "Cluster.HeartBeatDuration=1s", + "Cluster.HeartBeatMissLimit=3", + "Cluster.MessageQueueDepthPerPeer=4", + "Cluster.MaxRequestDuration=1s", + "Cluster.LivenessCheckRedundancy=2", + + "HTTPServer.TCPPort=" + testProxyFSDaemonHTTPPort, + + "SwiftClient.NoAuthIPAddr=" + testSwiftNoAuthIPAddr, + "SwiftClient.NoAuthTCPPort=" + testSwiftNoAuthPort, + "SwiftClient.Timeout=10s", + "SwiftClient.RetryLimit=1", + "SwiftClient.RetryLimitObject=1", + "SwiftClient.RetryDelay=10ms", + "SwiftClient.RetryDelayObject=10ms", + "SwiftClient.RetryExpBackoff=1.2", + "SwiftClient.RetryExpBackoffObject=2.0", + "SwiftClient.ChunkedConnectionPoolSize=64", + "SwiftClient.NonChunkedConnectionPoolSize=32", + "SwiftClient.SwiftReconChecksPerConfCheck=0", + + "PhysicalContainerLayout:PhysicalContainerLayoutReplicated3Way.ContainerStoragePolicy=silver", + "PhysicalContainerLayout:PhysicalContainerLayoutReplicated3Way.ContainerNamePrefix=Replicated3Way_", + "PhysicalContainerLayout:PhysicalContainerLayoutReplicated3Way.ContainersPerPeer=10", + "PhysicalContainerLayout:PhysicalContainerLayoutReplicated3Way.MaxObjectsPerContainer=1000000", + + "Volume:CommonVolume.FSID=1", + "Volume:CommonVolume.FUSEMountPointName=ProxyFSMountPointPath", + "Volume:CommonVolume.NFSExportClientMapList=CommonVolumeNFSClient0", + "Volume:CommonVolume.SMBShareName=CommonShare", + "Volume:CommonVolume.PrimaryPeer=Peer0", + "Volume:CommonVolume.AccountName=AUTH_test", + "Volume:CommonVolume.CheckpointContainerName=.__checkpoint__", + "Volume:CommonVolume.CheckpointContainerStoragePolicy=gold", + "Volume:CommonVolume.CheckpointInterval=10s", + "Volume:CommonVolume.DefaultPhysicalContainerLayout=PhysicalContainerLayoutReplicated3Way", + "Volume:CommonVolume.MaxFlushSize=10485760", + "Volume:CommonVolume.MaxFlushTime=10s", + "Volume:CommonVolume.FileDefragmentChunkSize=10485760", + "Volume:CommonVolume.FileDefragmentChunkDelay=10ms", + "Volume:CommonVolume.NonceValuesToReserve=100", + "Volume:CommonVolume.MaxEntriesPerDirNode=32", + "Volume:CommonVolume.MaxExtentsPerFileNode=32", + "Volume:CommonVolume.MaxInodesPerMetadataNode=32", + "Volume:CommonVolume.MaxLogSegmentsPerMetadataNode=64", + "Volume:CommonVolume.MaxDirFileNodesPerMetadataNode=16", + "Volume:CommonVolume.MaxBytesInodeCache=100000", + "Volume:CommonVolume.InodeCacheEvictInterval=1s", + "Volume:CommonVolume.AutoFormat=true", + "Volume:CommonVolume.ActiveLeaseEvictLowLimit=5000", + "Volume:CommonVolume.ActiveLeaseEvictHighLimit=5010", + + "NFSClientMap:CommonVolumeNFSClient0.ClientPattern=*", + "NFSClientMap:CommonVolumeNFSClient0.AccessMode=rw", + "NFSClientMap:CommonVolumeNFSClient0.RootSquash=no_root_squash", + "NFSClientMap:CommonVolumeNFSClient0.Secure=insecure", + + "VolumeGroup:CommonVolumeGroup.VolumeList=CommonVolume", + "VolumeGroup:CommonVolumeGroup.VirtualIPAddr=", + "VolumeGroup:CommonVolumeGroup.PrimaryPeer=Peer0", + "VolumeGroup:CommonVolumeGroup.ReadCacheLineSize=1000000", + "VolumeGroup:CommonVolumeGroup.ReadCacheWeight=100", + + "FSGlobals.VolumeGroupList=CommonVolumeGroup", + "FSGlobals.CheckpointHeaderConsensusAttempts=5", + "FSGlobals.MountRetryLimit=6", + "FSGlobals.MountRetryDelay=1s", + "FSGlobals.MountRetryExpBackoff=2", + "FSGlobals.LogCheckpointHeaderPosts=true", + "FSGlobals.TryLockBackoffMin=10ms", + "FSGlobals.TryLockBackoffMax=50ms", + "FSGlobals.TryLockSerializationThreshhold=5", + "FSGlobals.SymlinkMax=32", + "FSGlobals.CoalesceElementChunkSize=16", + "FSGlobals.InodeRecCacheEvictLowLimit=10000", + "FSGlobals.InodeRecCacheEvictHighLimit=10010", + "FSGlobals.LogSegmentRecCacheEvictLowLimit=10000", + "FSGlobals.LogSegmentRecCacheEvictHighLimit=10010", + "FSGlobals.BPlusTreeObjectCacheEvictLowLimit=10000", + "FSGlobals.BPlusTreeObjectCacheEvictHighLimit=10010", + "FSGlobals.DirEntryCacheEvictLowLimit=10000", + "FSGlobals.DirEntryCacheEvictHighLimit=10010", + "FSGlobals.FileExtentMapEvictLowLimit=10000", + "FSGlobals.FileExtentMapEvictHighLimit=10010", + "FSGlobals.EtcdEnabled=false", + + "JSONRPCServer.TCPPort=54326", + "JSONRPCServer.FastTCPPort=54327", + "JSONRPCServer.RetryRPCPort=54328", + "JSONRPCServer.RetryRPCTTLCompleted=10s", + "JSONRPCServer.RetryRPCAckTrim=10ms", + "JSONRPCServer.DataPathLogging=false", + "JSONRPCServer.MinLeaseDuration=250ms", + "JSONRPCServer.LeaseInterruptInterval=250ms", + "JSONRPCServer.LeaseInterruptLimit=20", + } + + testConfStrings = append(testConfStrings, "RamSwiftInfo.MaxAccountNameLength="+strconv.FormatUint(testMaxAccountNameLength, 10)) + testConfStrings = append(testConfStrings, "RamSwiftInfo.MaxContainerNameLength="+strconv.FormatUint(testMaxContainerNameLength, 10)) + testConfStrings = append(testConfStrings, "RamSwiftInfo.MaxObjectNameLength="+strconv.FormatUint(testMaxObjectNameLength, 10)) + testConfStrings = append(testConfStrings, "RamSwiftInfo.AccountListingLimit="+strconv.FormatUint(testAccountListingLimit, 10)) + testConfStrings = append(testConfStrings, "RamSwiftInfo.ContainerListingLimit="+strconv.FormatUint(testContainerListingLimit, 10)) + + ramswiftSignalHandlerIsArmedWG.Add(1) + testDaemonGlobals.ramswiftDoneChan = make(chan bool, 1) + + go ramswift.Daemon("/dev/null", testConfStrings, &ramswiftSignalHandlerIsArmedWG, testDaemonGlobals.ramswiftDoneChan, unix.SIGUSR1) + + ramswiftSignalHandlerIsArmedWG.Wait() + + for { + infoResponse, err = http.Get("http://" + testSwiftNoAuthIPAddr + ":" + testSwiftNoAuthPort + "/info") + if (nil == err) && (http.StatusOK == infoResponse.StatusCode) { + break + } + + time.Sleep(testDaemonStartPollInterval) + } + + testDaemonGlobals.proxyfsdErrChan = make(chan error, 1) // Must be buffered to avoid race + + go proxyfsd.Daemon("/dev/null", testConfStrings, testDaemonGlobals.proxyfsdErrChan, &testDaemonGlobals.proxyfsdWG, []string{}, unix.SIGUSR2) + + err = <-testDaemonGlobals.proxyfsdErrChan + if nil != err { + t.Fatalf("proxyfsd.Daemon() startup failed: %v", err) + } + + for { + versionResponse, err = http.Get("http://" + testProxyFSDaemonIPAddr + ":" + testProxyFSDaemonHTTPPort + "/version") + if (nil == err) && (http.StatusOK == versionResponse.StatusCode) { + break + } + + time.Sleep(testDaemonStartPollInterval) + } + + testConfMap, err = conf.MakeConfMapFromStrings(testConfStrings) + if nil != err { + t.Fatalf("conf.MakeConfMapFromStrings() failed: %v", err) + } + + globals.logFile = nil + globals.config.LogFilePath = "" + globals.config.LogToConsole = true + + startSwiftProxyEmulator(t, testConfMap) + + initializeGlobals(testConfMap) + + // Fake out that plug-in auth has already obtained AuthToken & StorageURL + + globals.swiftAuthToken = testAuthToken + globals.swiftStorageURL = "http://" + testSwiftProxyAddr + "/proxyfs/" + testAccountName + + go testSwallowFissionErrChan(t, globals.fissionErrChan) + + doMountProxyFS() + + performMountFUSE() +} + +func testSwallowFissionErrChan(t *testing.T, fissionErrChan chan error) { + var ( + err error + ) + + err = <-fissionErrChan + if nil != err { + t.Fatalf("fissionErrChan received err: %v", err) + } +} + +func testTeardown(t *testing.T) { + var ( + err error + testDir string + ) + + performUnmountFUSE() + + emptyFileInodeDirtyListAndLogSegmentChan() + + doUnmountProxyFS() + + uninitializeGlobals() + + _ = unix.Kill(unix.Getpid(), unix.SIGUSR2) + + err = <-testDaemonGlobals.proxyfsdErrChan + + testDaemonGlobals.proxyfsdWG.Wait() + + if nil != err { + t.Fatalf("proxyfsd.Daemon() exited with error: %v", err) + } + + unix.Kill(unix.Getpid(), unix.SIGUSR1) + + _ = <-testDaemonGlobals.ramswiftDoneChan + + testDir, err = os.Getwd() + if nil != err { + t.Fatalf("os.Getwd() failed: %v", err) + } + + err = os.Chdir("..") + if nil != err { + t.Fatalf("os.Chdir() failed: %v", err) + } + + err = os.RemoveAll(testDir) + if nil != err { + t.Fatalf("os.RemoveAll() failed: %v", err) + } + + stopSwiftProxyEmulator() +} diff --git a/emswift/emswiftpkg/swift_proxy_emulator_test.go_HIDE b/emswift/emswiftpkg/swift_proxy_emulator_test.go_HIDE new file mode 100644 index 000000000..8f44734c6 --- /dev/null +++ b/emswift/emswiftpkg/swift_proxy_emulator_test.go_HIDE @@ -0,0 +1,411 @@ +// Copyright (c) 2015-2021, NVIDIA CORPORATION. +// SPDX-License-Identifier: Apache-2.0 + +package emswiftpkg + +import ( + "context" + "io/ioutil" + "net" + "net/http" + "strconv" + "strings" + "sync" + "testing" + "time" + + "github.com/swiftstack/ProxyFS/conf" +) + +const ( + testAuthToken = "AUTH_tkTestToken" + testJrpcResponseBufSize = 1024 * 1024 +) + +type testSwiftProxyEmulatorGlobalsStruct struct { + sync.WaitGroup + t *testing.T + ramswiftNoAuthURL string + proxyfsdJrpcTCPAddr *net.TCPAddr + jrpcResponsePool *sync.Pool + httpClient *http.Client + httpServer *http.Server +} + +var testSwiftProxyEmulatorGlobals testSwiftProxyEmulatorGlobalsStruct + +func startSwiftProxyEmulator(t *testing.T, confMap conf.ConfMap) { + var ( + err error + infoResponse *http.Response + jrpcServerIPAddr string + jrpcServerTCPPort uint16 + swiftClientNoAuthIPAddr string + swiftClientNoAuthTCPPort uint16 + whoAmI string + ) + + testSwiftProxyEmulatorGlobals.t = t + + swiftClientNoAuthIPAddr, err = confMap.FetchOptionValueString("SwiftClient", "NoAuthIPAddr") + if nil != err { + t.Fatal(err) + } + + swiftClientNoAuthTCPPort, err = confMap.FetchOptionValueUint16("SwiftClient", "NoAuthTCPPort") + if nil != err { + t.Fatal(err) + } + + testSwiftProxyEmulatorGlobals.ramswiftNoAuthURL = "http://" + net.JoinHostPort(swiftClientNoAuthIPAddr, strconv.FormatUint(uint64(swiftClientNoAuthTCPPort), 10)) + + whoAmI, err = confMap.FetchOptionValueString("Cluster", "WhoAmI") + if nil != err { + t.Fatal(err) + } + + jrpcServerIPAddr, err = confMap.FetchOptionValueString("Peer:"+whoAmI, "PrivateIPAddr") + if nil != err { + t.Fatal(err) + } + + jrpcServerTCPPort, err = confMap.FetchOptionValueUint16("JSONRPCServer", "TCPPort") + if nil != err { + t.Fatal(err) + } + + testSwiftProxyEmulatorGlobals.proxyfsdJrpcTCPAddr, err = net.ResolveTCPAddr("tcp", net.JoinHostPort(jrpcServerIPAddr, strconv.FormatUint(uint64(jrpcServerTCPPort), 10))) + if nil != err { + t.Fatal(err) + } + + testSwiftProxyEmulatorGlobals.httpClient = &http.Client{} + + testSwiftProxyEmulatorGlobals.httpServer = &http.Server{ + Addr: testSwiftProxyAddr, + Handler: &testSwiftProxyEmulatorGlobals, + } + + testSwiftProxyEmulatorGlobals.jrpcResponsePool = &sync.Pool{ + New: func() (bufAsInterface interface{}) { + var ( + bufAsByteSlice []byte + ) + + bufAsByteSlice = make([]byte, testJrpcResponseBufSize) + + bufAsInterface = bufAsByteSlice + + return + }, + } + + testSwiftProxyEmulatorGlobals.Add(1) + + go func() { + _ = testSwiftProxyEmulatorGlobals.httpServer.ListenAndServe() + + testSwiftProxyEmulatorGlobals.Done() + }() + + for { + infoResponse, err = http.Get("http://" + testSwiftProxyAddr + "/info") + if nil == err { + break + } + + time.Sleep(testDaemonStartPollInterval) + } + + if http.StatusOK != infoResponse.StatusCode { + t.Fatalf("GET /info from ServeHTTP() got unexpected status %s", infoResponse.Status) + } +} + +func stopSwiftProxyEmulator() { + var ( + err error + ) + + err = testSwiftProxyEmulatorGlobals.httpServer.Shutdown(context.Background()) + if nil != err { + testSwiftProxyEmulatorGlobals.t.Fatalf("testSwiftProxyEmulatorGlobals.httpServer.Shutdown() failed: %v", err) + } + + testSwiftProxyEmulatorGlobals.Wait() + + testSwiftProxyEmulatorGlobals.jrpcResponsePool = nil +} + +func (dummy *testSwiftProxyEmulatorGlobalsStruct) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) { + // Handle the GET of/on info & AuthURL cases + + if http.MethodGet == request.Method { + switch request.URL.Path { + case "/info": + doInfo(responseWriter) + return + case "/auth/v1.0": + doAuth(responseWriter, request) + return + default: + // Fall through to normal processing + } + } + + // Reject unauthorized requests + + if request.Header.Get("X-Auth-Token") != testAuthToken { + responseWriter.WriteHeader(http.StatusUnauthorized) + return + } + + // Branch off to individual request method handlers + + switch request.Method { + case http.MethodGet: + doGET(responseWriter, request) + case http.MethodPut: + doPUT(responseWriter, request) + case "PROXYFS": + doRPC(responseWriter, request) + default: + responseWriter.WriteHeader(http.StatusMethodNotAllowed) + } +} + +func doInfo(authResponseWriter http.ResponseWriter) { + var ( + err error + getBuf []byte + noAuthResponse *http.Response + ) + + noAuthResponse, err = http.Get(testSwiftProxyEmulatorGlobals.ramswiftNoAuthURL + "/info") + if nil != err { + testSwiftProxyEmulatorGlobals.t.Fatalf("GET of /info from ramswift failed: %v", err) + } + + if http.StatusOK != noAuthResponse.StatusCode { + testSwiftProxyEmulatorGlobals.t.Fatalf("GET of /info from ramswift returned bad status: %v", noAuthResponse.Status) + } + + getBuf, err = ioutil.ReadAll(noAuthResponse.Body) + if nil != err { + testSwiftProxyEmulatorGlobals.t.Fatalf("GET of /info returned unreadable Body: %v", err) + } + + err = noAuthResponse.Body.Close() + if nil != err { + testSwiftProxyEmulatorGlobals.t.Fatalf("GET of /info returned uncloseable Body: %v", err) + } + + authResponseWriter.WriteHeader(http.StatusOK) + _, _ = authResponseWriter.Write(getBuf) +} + +func doAuth(authResponseWriter http.ResponseWriter, authRequest *http.Request) { + if authRequest.Header.Get("X-Auth-User") != testAuthUser { + authResponseWriter.WriteHeader(http.StatusUnauthorized) + return + } + if authRequest.Header.Get("X-Auth-Key") != testAuthKey { + authResponseWriter.WriteHeader(http.StatusUnauthorized) + return + } + authResponseWriter.Header().Add("X-Auth-Token", testAuthToken) + authResponseWriter.Header().Add("X-Storage-Url", "http://"+testSwiftProxyAddr+"/v1/"+testAccountName) + authResponseWriter.WriteHeader(http.StatusOK) +} + +// doGET proxies the GET over to ramswift +// +func doGET(authResponseWriter http.ResponseWriter, authRequest *http.Request) { + var ( + contentRangeHeader string + contentTypeHeader string + err error + getBuf []byte + hostHeader string + noAuthPath string + noAuthRequest *http.Request + noAuthResponse *http.Response + noAuthStatusCode int + rangeHeader string + ) + + if !strings.HasPrefix(authRequest.URL.Path, "/proxyfs/"+testAccountName) { + authResponseWriter.WriteHeader(http.StatusNotFound) + return + } + + noAuthPath = strings.Replace(authRequest.URL.Path, "proxyfs", "v1", 1) + + noAuthRequest, err = http.NewRequest("GET", testSwiftProxyEmulatorGlobals.ramswiftNoAuthURL+noAuthPath, nil) + if nil != err { + authResponseWriter.WriteHeader(http.StatusBadRequest) + return + } + + hostHeader = authRequest.Header.Get("Host") + if "" != hostHeader { + noAuthRequest.Header.Add("Host", hostHeader) + } + + rangeHeader = authRequest.Header.Get("Range") + if "" != rangeHeader { + noAuthRequest.Header.Add("Range", rangeHeader) + } + + noAuthResponse, err = testSwiftProxyEmulatorGlobals.httpClient.Do(noAuthRequest) + if nil != err { + authResponseWriter.WriteHeader(http.StatusBadRequest) + return + } + + noAuthStatusCode = noAuthResponse.StatusCode + + if (http.StatusOK != noAuthStatusCode) && (http.StatusPartialContent != noAuthStatusCode) { + _ = noAuthResponse.Body.Close() + authResponseWriter.WriteHeader(noAuthStatusCode) + return + } + + getBuf, err = ioutil.ReadAll(noAuthResponse.Body) + if nil != err { + _ = noAuthResponse.Body.Close() + authResponseWriter.WriteHeader(http.StatusBadRequest) + return + } + + err = noAuthResponse.Body.Close() + if nil != err { + authResponseWriter.WriteHeader(http.StatusBadRequest) + return + } + + contentTypeHeader = noAuthResponse.Header.Get("Content-Type") + if "" != contentTypeHeader { + authResponseWriter.Header().Add("Content-Type", contentTypeHeader) + } + + contentRangeHeader = noAuthResponse.Header.Get("Content-Range") + if "" != contentRangeHeader { + authResponseWriter.Header().Add("Content-Range", contentRangeHeader) + } + + authResponseWriter.WriteHeader(noAuthStatusCode) + + _, _ = authResponseWriter.Write(getBuf) +} + +// doPUT proxies the GET over to ramswift +// +func doPUT(authResponseWriter http.ResponseWriter, authRequest *http.Request) { + var ( + err error + hostHeader string + noAuthPath string + noAuthRequest *http.Request + noAuthResponse *http.Response + ) + + if !strings.HasPrefix(authRequest.URL.Path, "/proxyfs/"+testAccountName) { + _ = authRequest.Body.Close() + authResponseWriter.WriteHeader(http.StatusNotFound) + return + } + + noAuthPath = strings.Replace(authRequest.URL.Path, "proxyfs", "v1", 1) + + noAuthRequest, err = http.NewRequest("PUT", testSwiftProxyEmulatorGlobals.ramswiftNoAuthURL+noAuthPath, authRequest.Body) + if nil != err { + _ = authRequest.Body.Close() + authResponseWriter.WriteHeader(http.StatusBadRequest) + return + } + + hostHeader = authRequest.Header.Get("Host") + if "" != hostHeader { + noAuthRequest.Header.Add("Host", hostHeader) + } + + noAuthResponse, err = testSwiftProxyEmulatorGlobals.httpClient.Do(noAuthRequest) + if nil != err { + _ = authRequest.Body.Close() + authResponseWriter.WriteHeader(http.StatusBadRequest) + return + } + + err = authRequest.Body.Close() + if nil != err { + authResponseWriter.WriteHeader(http.StatusBadRequest) + return + } + + authResponseWriter.WriteHeader(noAuthResponse.StatusCode) +} + +// doRPC proxies the payload as a JSON RPC request over to proxyfsd +// +func doRPC(responseWriter http.ResponseWriter, request *http.Request) { + var ( + err error + jrpcResponseBuf []byte + jrpcResponseLen int + jrpcRequestBuf []byte + tcpConn *net.TCPConn + ) + + if !strings.HasPrefix(request.URL.Path, "/proxyfs/"+testAccountName) { + _ = request.Body.Close() + responseWriter.WriteHeader(http.StatusNotFound) + return + } + + jrpcRequestBuf, err = ioutil.ReadAll(request.Body) + _ = request.Body.Close() + if nil != err { + responseWriter.WriteHeader(http.StatusBadRequest) + return + } + + if request.Header.Get("Content-Type") != "application/json" { + responseWriter.WriteHeader(http.StatusBadRequest) + return + } + + tcpConn, err = net.DialTCP("tcp", nil, testSwiftProxyEmulatorGlobals.proxyfsdJrpcTCPAddr) + if nil != err { + responseWriter.WriteHeader(http.StatusServiceUnavailable) + return + } + + _, err = tcpConn.Write(jrpcRequestBuf) + if nil != err { + _ = tcpConn.Close() + responseWriter.WriteHeader(http.StatusServiceUnavailable) + return + } + + jrpcResponseBuf = testSwiftProxyEmulatorGlobals.jrpcResponsePool.Get().([]byte) + + jrpcResponseLen, err = tcpConn.Read(jrpcResponseBuf) + if nil != err { + _ = tcpConn.Close() + responseWriter.WriteHeader(http.StatusServiceUnavailable) + return + } + + err = tcpConn.Close() + if nil != err { + responseWriter.WriteHeader(http.StatusServiceUnavailable) + return + } + + responseWriter.Header().Add("Content-Type", "application/json") + responseWriter.WriteHeader(http.StatusOK) + _, _ = responseWriter.Write(jrpcResponseBuf[:jrpcResponseLen]) + + testSwiftProxyEmulatorGlobals.jrpcResponsePool.Put(jrpcResponseBuf) +} diff --git a/emswift/main.go b/emswift/main.go new file mode 100644 index 000000000..ed6b83fc9 --- /dev/null +++ b/emswift/main.go @@ -0,0 +1,69 @@ +// Copyright (c) 2015-2021, NVIDIA CORPORATION. +// SPDX-License-Identifier: Apache-2.0 + +package main + +import ( + "fmt" + "os" + "os/signal" + + "golang.org/x/sys/unix" + + "github.com/swiftstack/ProxyFS/conf" + "github.com/swiftstack/ProxyFS/emswift/emswiftpkg" +) + +func main() { + var ( + confMap conf.ConfMap + err error + signalChan chan os.Signal + ) + + if len(os.Args) < 2 { + fmt.Fprintf(os.Stderr, "no .conf file specified\n") + os.Exit(1) + } + + confMap, err = conf.MakeConfMapFromFile(os.Args[1]) + if nil != err { + fmt.Fprintf(os.Stderr, "failed to load config: %v\n", err) + os.Exit(1) + } + + err = confMap.UpdateFromStrings(os.Args[2:]) + if nil != err { + fmt.Fprintf(os.Stderr, "failed to apply config overrides: %v\n", err) + os.Exit(1) + } + + // Arm signal handler used to indicate termination and wait on it + // + // Note: signalled chan must be buffered to avoid race with window between + // arming handler and blocking on the chan read + + signalChan = make(chan os.Signal, 1) + + signal.Notify(signalChan, unix.SIGINT, unix.SIGTERM, unix.SIGHUP) + + // Start Swift Emulation + + err = emswiftpkg.Start(confMap) + if nil != err { + fmt.Fprintf(os.Stderr, "emswiftpkg.Start(confMap) failed: %v\n", err) + os.Exit(1) + } + + // Await any of the above specified signals + + _ = <-signalChan + + // Stop Swift Emulation + + emswiftpkg.Stop() + if nil != err { + fmt.Fprintf(os.Stderr, "emswiftpkg.Stop() failed: %v\n", err) + os.Exit(1) + } +} diff --git a/imgr/imgrpkg/Makefile b/imgr/imgrpkg/Makefile new file mode 100644 index 000000000..9fe6f3f1e --- /dev/null +++ b/imgr/imgrpkg/Makefile @@ -0,0 +1,6 @@ +# Copyright (c) 2015-2021, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 + +gosubdir := github.com/swiftstack/ProxyFS/imgr/imgrpkg + +include ../../GoMakefile diff --git a/imgr/imgrpkg/dummy.go b/imgr/imgrpkg/dummy.go new file mode 100644 index 000000000..e1af09375 --- /dev/null +++ b/imgr/imgrpkg/dummy.go @@ -0,0 +1,4 @@ +// Copyright (c) 2015-2021, NVIDIA CORPORATION. +// SPDX-License-Identifier: Apache-2.0 + +package imgrpkg diff --git a/imgr/imgrpkg/dummy_test.go b/imgr/imgrpkg/dummy_test.go new file mode 100644 index 000000000..0b0d310b5 --- /dev/null +++ b/imgr/imgrpkg/dummy_test.go @@ -0,0 +1,11 @@ +// Copyright (c) 2015-2021, NVIDIA CORPORATION. +// SPDX-License-Identifier: Apache-2.0 + +package imgrpkg + +import ( + "testing" +) + +func TestDummy(t *testing.T) { +} From c053f24a4e71d88d6f3b1db051a178ec62c6d7d0 Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Tue, 26 Jan 2021 10:51:33 -0800 Subject: [PATCH 012/160] Ported over package ramswift's daemon_test.go to emswiftpkg - Auth stub'd / NoAuth fails (for now) --- emswift/emswiftpkg/dummy_test.go | 11 - emswift/emswiftpkg/pkg_test.go | 1283 ++++++++++++++++++++++++++++++ emswift/main.go | 20 +- 3 files changed, 1292 insertions(+), 22 deletions(-) delete mode 100644 emswift/emswiftpkg/dummy_test.go create mode 100644 emswift/emswiftpkg/pkg_test.go diff --git a/emswift/emswiftpkg/dummy_test.go b/emswift/emswiftpkg/dummy_test.go deleted file mode 100644 index 7c7334abd..000000000 --- a/emswift/emswiftpkg/dummy_test.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2015-2021, NVIDIA CORPORATION. -// SPDX-License-Identifier: Apache-2.0 - -package emswiftpkg - -import ( - "testing" -) - -func TestDummy(t *testing.T) { -} diff --git a/emswift/emswiftpkg/pkg_test.go b/emswift/emswiftpkg/pkg_test.go new file mode 100644 index 000000000..a19ad55d8 --- /dev/null +++ b/emswift/emswiftpkg/pkg_test.go @@ -0,0 +1,1283 @@ +// Copyright (c) 2015-2021, NVIDIA CORPORATION. +// SPDX-License-Identifier: Apache-2.0 + +package emswiftpkg + +import ( + "bytes" + "io" + "io/ioutil" + "net/http" + "strings" + "testing" + + "github.com/swiftstack/ProxyFS/conf" + "github.com/swiftstack/ProxyFS/utils" +) + +func TestAuthEmulation(t *testing.T) { + var ( + confMap conf.ConfMap + confStrings = []string{ + "EMSWIFT.AuthIPAddr=127.0.0.1", + "EMSWIFT.AuthTCPPort=9998", + "EMSWIFT.NoAuthIPAddr=127.0.0.1", + "EMSWIFT.NoAuthTCPPort=9999", + "EMSWIFT.MaxAccountNameLength=256", + "EMSWIFT.MaxContainerNameLength=256", + "EMSWIFT.MaxObjectNameLength=1024", + "EMSWIFT.AccountListingLimit=10000", + "EMSWIFT.ContainerListingLimit=10000", + } + err error + ) + + confMap, err = conf.MakeConfMapFromStrings(confStrings) + if nil != err { + t.Fatalf("conf.MakeConfMapFromStrings(confStrings) returned unexpected error: %v", err) + } + + err = Start(confMap) + if nil != err { + t.Fatalf("Start(confMap) returned unexpected error: %v", err) + } + + t.Logf("TODO: Implement TestAuthEmulation() test steps") + + err = Stop() + if nil != err { + t.Fatalf("Stop() returned unexpected error: %v", err) + } +} + +func TestNoAuthEmulation(t *testing.T) { + var ( + confMap conf.ConfMap + confStrings = []string{ + "EMSWIFT.NoAuthIPAddr=127.0.0.1", + "EMSWIFT.NoAuthTCPPort=9999", + "EMSWIFT.MaxAccountNameLength=256", + "EMSWIFT.MaxContainerNameLength=256", + "EMSWIFT.MaxObjectNameLength=1024", + "EMSWIFT.AccountListingLimit=10000", + "EMSWIFT.ContainerListingLimit=10000", + } + contentType string + contentTypeMultiPartBoundary string + err error + errChan chan error + expectedBuf []byte + expectedInfo string + httpClient *http.Client + httpRequest *http.Request + httpResponse *http.Response + mouseHeaderPresent bool + pipeReader *io.PipeReader + pipeWriter *io.PipeWriter + readBuf []byte + urlForInfo string + urlPrefix string + ) + + confMap, err = conf.MakeConfMapFromStrings(confStrings) + if nil != err { + t.Fatalf("conf.MakeConfMapFromStrings(confStrings) returned unexpected error: %v", err) + } + + err = Start(confMap) + if nil != err { + t.Fatalf("Start(confMap) returned unexpected error: %v", err) + } + + // Setup http.Client that we will use for all HTTP requests + + httpClient = &http.Client{} + + // Send a GET for "/info" expecting [RamSwiftInfo] data in compact JSON form + + httpRequest, err = http.NewRequest("GET", urlForInfo, nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusOK != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + expectedInfo = "{\"swift\": {\"max_account_name_length\": 256,\"max_container_name_length\": 256,\"max_object_name_length\": 1024,\"account_listing_limit\": 10000,\"container_listing_limit\": 10000}}" + if int64(len(expectedInfo)) != httpResponse.ContentLength { + t.Fatalf("GET of /info httpResponse.ContentLength unexpected") + } + readBuf, err = ioutil.ReadAll(httpResponse.Body) + if nil != err { + t.Fatalf("ioutil.ReadAll() returned unexpected error: %v", err) + } + if expectedInfo != utils.ByteSliceToString(readBuf) { + t.Fatalf("GET of /info httpResponse.Body contents unexpected") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a PUT for account "TestAccount" and header Cat: Dog + + httpRequest, err = http.NewRequest("PUT", urlPrefix+"TestAccount", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("Cat", "Dog") + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusCreated != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a HEAD for account "TestAccount" expecting header Cat: Dog + + httpRequest, err = http.NewRequest("HEAD", urlPrefix+"TestAccount", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestAccount should have header Cat: Dog") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a GET for account "TestAccount" expecting Content-Length: 0 and header Cat: Dog + + httpRequest, err = http.NewRequest("GET", urlPrefix+"TestAccount", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestAccount should have header Cat: Dog") + } + if 0 != httpResponse.ContentLength { + t.Fatalf("TestAccount should contain no elements at this point") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a POST for account "TestAccount" and header Mouse: Bird + + httpRequest, err = http.NewRequest("POST", urlPrefix+"TestAccount", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("Mouse", "Bird") + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a HEAD for account "TestAccount" expecting header Cat: Dog & Mouse: Bird + + httpRequest, err = http.NewRequest("HEAD", urlPrefix+"TestAccount", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestAccount should have header Cat: Dog") + } + if httpResponse.Header.Get("Mouse") != "Bird" { + t.Fatalf("TestAccount should have header Mouse: Bird") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a POST for account "TestAccount" deleting header Mouse + + httpRequest, err = http.NewRequest("POST", urlPrefix+"TestAccount", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("Mouse", "") + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a HEAD for account "TestAccount" expecting header Cat: Dog & no Mouse header + + httpRequest, err = http.NewRequest("HEAD", urlPrefix+"TestAccount", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestAccount should have header Cat: Dog") + } + _, mouseHeaderPresent = httpResponse.Header["Mouse"] + if mouseHeaderPresent { + t.Fatalf("TestAccount should not have header Mouse") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a PUT for account "TestAccount" and header Mouse: Bird + + httpRequest, err = http.NewRequest("PUT", urlPrefix+"TestAccount", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("Mouse", "Bird") + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusAccepted != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a HEAD for account "TestAccount" expecting header Cat: Dog & Mouse: Bird + + httpRequest, err = http.NewRequest("HEAD", urlPrefix+"TestAccount", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestAccount should have header Cat: Dog") + } + if httpResponse.Header.Get("Mouse") != "Bird" { + t.Fatalf("TestAccount should have header Mouse: Bird") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a PUT for account "TestAccount" deleting header Mouse + + httpRequest, err = http.NewRequest("PUT", urlPrefix+"TestAccount", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("Mouse", "") + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusAccepted != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a HEAD for account "TestAccount" expecting header Cat: Dog & no Mouse header + + httpRequest, err = http.NewRequest("HEAD", urlPrefix+"TestAccount", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestAccount should have header Cat: Dog") + } + _, mouseHeaderPresent = httpResponse.Header["Mouse"] + if mouseHeaderPresent { + t.Fatalf("TestAccount should not have header Mouse") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a PUT for container "TestContainer" and header Cat: Dog + + httpRequest, err = http.NewRequest("PUT", urlPrefix+"TestAccount/TestContainer", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("Cat", "Dog") + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusCreated != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a GET for account "TestAccount" expecting "TestContainer\n" and header Cat: Dog + + httpRequest, err = http.NewRequest("GET", urlPrefix+"TestAccount", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusOK != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestAccount should have header Cat: Dog") + } + if int64(len("TestContainer\n")) != httpResponse.ContentLength { + t.Fatalf("TestAccount should contain only \"TestContainer\\n\" at this point") + } + readBuf, err = ioutil.ReadAll(httpResponse.Body) + if nil != err { + t.Fatalf("ioutil.ReadAll() returned unexpected error: %v", err) + } + if "TestContainer\n" != utils.ByteSliceToString(readBuf) { + t.Fatalf("TestAccount should contain only \"TestContainer\\n\" at this point") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a GET for account "TestAccount" with marker "AAA" expecting "TestContainer\n" and header Cat: Dog + + httpRequest, err = http.NewRequest("GET", urlPrefix+"TestAccount?marker=AAA", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusOK != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestAccount should have header Cat: Dog") + } + if int64(len("TestContainer\n")) != httpResponse.ContentLength { + t.Fatalf("TestAccount should contain only \"TestContainer\\n\" at this point") + } + readBuf, err = ioutil.ReadAll(httpResponse.Body) + if nil != err { + t.Fatalf("ioutil.ReadAll() returned unexpected error: %v", err) + } + if "TestContainer\n" != utils.ByteSliceToString(readBuf) { + t.Fatalf("TestAccount should contain only \"TestContainer\\n\" at this point") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a GET for account "TestAccount" with marker "ZZZ" expecting Content-Length: 0 and header Cat: Dog + + httpRequest, err = http.NewRequest("GET", urlPrefix+"TestAccount?marker=ZZZ", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestAccount should have header Cat: Dog") + } + if 0 != httpResponse.ContentLength { + t.Fatalf("TestAccount should contain no elements at this point") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a HEAD for container "TestContainer" expecting header Cat: Dog + + httpRequest, err = http.NewRequest("HEAD", urlPrefix+"TestAccount/TestContainer", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestContainer should have header Cat: Dog") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a GET for container "TestContainer" expecting Content-Length: 0 and header Cat: Dog + + httpRequest, err = http.NewRequest("GET", urlPrefix+"TestAccount/TestContainer", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestContainer should have header Cat: Dog") + } + if 0 != httpResponse.ContentLength { + t.Fatalf("TestContainer should contain no elements at this point") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a POST for container "TestContainer" and header Mouse: Bird + + httpRequest, err = http.NewRequest("POST", urlPrefix+"TestAccount/TestContainer", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("Mouse", "Bird") + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a HEAD for container "TestContainer" expecting header Cat: Dog & Mouse: Bird + + httpRequest, err = http.NewRequest("HEAD", urlPrefix+"TestAccount/TestContainer", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestContainer should have header Cat: Dog") + } + if httpResponse.Header.Get("Mouse") != "Bird" { + t.Fatalf("TestContainer should have header Mouse: Bird") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a POST for container "TestContainer" deleting header Mouse + + httpRequest, err = http.NewRequest("POST", urlPrefix+"TestAccount/TestContainer", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("Mouse", "") + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a HEAD for container "TestContainer" expecting header Cat: Dog & no Mouse header + + httpRequest, err = http.NewRequest("HEAD", urlPrefix+"TestAccount/TestContainer", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestContainer should have header Cat: Dog") + } + _, mouseHeaderPresent = httpResponse.Header["Mouse"] + if mouseHeaderPresent { + t.Fatalf("TestContainer should not have header Mouse") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a PUT for container "TestContainer" and header Mouse: Bird + + httpRequest, err = http.NewRequest("PUT", urlPrefix+"TestAccount/TestContainer", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("Mouse", "Bird") + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusAccepted != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a HEAD for container "TestContainer" expecting header Cat: Dog & Mouse: Bird + + httpRequest, err = http.NewRequest("HEAD", urlPrefix+"TestAccount/TestContainer", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestContainer should have header Cat: Dog") + } + if httpResponse.Header.Get("Mouse") != "Bird" { + t.Fatalf("TestContainer should have header Mouse: Bird") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a PUT for container "TestContainer" deleting header Mouse + + httpRequest, err = http.NewRequest("PUT", urlPrefix+"TestAccount/TestContainer", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("Mouse", "") + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusAccepted != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a HEAD for container "TestContainer" expecting header Cat: Dog & no Mouse header + + httpRequest, err = http.NewRequest("HEAD", urlPrefix+"TestAccount/TestContainer", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestContainer should have header Cat: Dog") + } + _, mouseHeaderPresent = httpResponse.Header["Mouse"] + if mouseHeaderPresent { + t.Fatalf("TestContainer should not have header Mouse") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a non-chunked PUT for object "Foo" to contain []byte{0x00, 0x01, 0x02} + + httpRequest, err = http.NewRequest("PUT", urlPrefix+"TestAccount/TestContainer/Foo", bytes.NewReader([]byte{0x00, 0x01, 0x02})) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusCreated != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a chunked PUT for object "Bar"" with 1st chunk being []byte{0xAA, 0xBB} & 2nd chunk being []byte{0xCC, 0xDD, 0xEE} + + pipeReader, pipeWriter = io.Pipe() + httpRequest, err = http.NewRequest("PUT", urlPrefix+"TestAccount/TestContainer/Bar", pipeReader) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.ContentLength = -1 + httpRequest.Header.Del("Content-Length") + errChan = make(chan error, 1) + go func() { + var ( + nonShadowingErr error + nonShadowingHTTPResponse *http.Response + ) + nonShadowingHTTPResponse, nonShadowingErr = httpClient.Do(httpRequest) + if nil == nonShadowingErr { + httpResponse = nonShadowingHTTPResponse + } + errChan <- nonShadowingErr + }() + _, err = pipeWriter.Write([]byte{0xAA, 0xBB}) + if nil != err { + t.Fatalf("pipeWriter.Write() returned unexpected error: %v", err) + } + _, err = pipeWriter.Write([]byte{0xCC, 0xDD, 0xEE}) + if nil != err { + t.Fatalf("pipeWriter.Write() returned unexpected error: %v", err) + } + err = pipeWriter.Close() + if nil != err { + t.Fatalf("pipeWriter.Close() returned unexpected error: %v", err) + } + err = <-errChan + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusCreated != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a GET for container "TestContainer" expecting "Bar\nFoo\n" and header Cat: Dog + + httpRequest, err = http.NewRequest("GET", urlPrefix+"TestAccount/TestContainer", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusOK != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestAccount should have header Cat: Dog") + } + if int64(len("Bar\nFoo\n")) != httpResponse.ContentLength { + t.Fatalf("TestContainer should contain only \"Bar\\nFoo\\n\" at this point") + } + readBuf, err = ioutil.ReadAll(httpResponse.Body) + if nil != err { + t.Fatalf("ioutil.ReadAll() returned unexpected error: %v", err) + } + if "Bar\nFoo\n" != utils.ByteSliceToString(readBuf) { + t.Fatalf("TestContainer should contain only \"Bar\\nFoo\\n\" at this point") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a GET for container "TestContainer" with marker "AAA" expecting "Bar\nFoo\n" and header Cat: Dog + + httpRequest, err = http.NewRequest("GET", urlPrefix+"TestAccount/TestContainer?marker=AAA", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusOK != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestAccount should have header Cat: Dog") + } + if int64(len("Bar\nFoo\n")) != httpResponse.ContentLength { + t.Fatalf("TestContainer should contain only \"Bar\\nFoo\\n\" at this point") + } + readBuf, err = ioutil.ReadAll(httpResponse.Body) + if nil != err { + t.Fatalf("ioutil.ReadAll() returned unexpected error: %v", err) + } + if "Bar\nFoo\n" != utils.ByteSliceToString(readBuf) { + t.Fatalf("TestContainer should contain only \"Bar\\nFoo\\n\" at this point") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a GET for container "TestContainer" with marker "ZZZ" expecting Content-Length: 0 and header Cat: Dog + + httpRequest, err = http.NewRequest("GET", urlPrefix+"TestAccount/TestContainer?marker=ZZZ", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestContainer should have header Cat: Dog") + } + if 0 != httpResponse.ContentLength { + t.Fatalf("TestContainer should contain no elements at this point") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a HEAD for object "Foo" expecting Content-Length: 3 + + httpRequest, err = http.NewRequest("HEAD", urlPrefix+"TestAccount/TestContainer/Foo", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusOK != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if 3 != httpResponse.ContentLength { + t.Fatalf("httpResponse.ContentLength contained unexpected value: %v", httpResponse.ContentLength) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a full object GET for object "Foo" expecting []byte{0x00, 0x01, 0x02} + + httpRequest, err = http.NewRequest("GET", urlPrefix+"TestAccount/TestContainer/Foo", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusOK != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if int64(len([]byte{0x00, 0x01, 0x02})) != httpResponse.ContentLength { + t.Fatalf("Foo should contain precisely []byte{0x00, 0x01, 0x02}") + } + readBuf, err = ioutil.ReadAll(httpResponse.Body) + if nil != err { + t.Fatalf("ioutil.ReadAll() returned unexpected error: %v", err) + } + if 0 != bytes.Compare([]byte{0x00, 0x01, 0x02}, readBuf) { + t.Fatalf("Foo should contain precisely []byte{0x00, 0x01, 0x02}") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a range GET of bytes at offset 1 for length 3 for object "Bar" expecting []byte{0xBB, 0xCC, 0xDD} + + httpRequest, err = http.NewRequest("GET", urlPrefix+"TestAccount/TestContainer/Bar", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("Range", "bytes=1-3") + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusPartialContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if int64(len([]byte{0xBB, 0xCC, 0xDD})) != httpResponse.ContentLength { + t.Fatalf("Bar's bytes 1-3 should contain precisely []byte{0xBB, 0xCC, 0xDD}") + } + readBuf, err = ioutil.ReadAll(httpResponse.Body) + if nil != err { + t.Fatalf("ioutil.ReadAll() returned unexpected error: %v", err) + } + if 0 != bytes.Compare([]byte{0xBB, 0xCC, 0xDD}, readBuf) { + t.Fatalf("Bar's bytes 1-3 should contain precisely []byte{0xBB, 0xCC, 0xDD}") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a range GET of bytes at offset 0 for length 2 + // and offset 3 for length of 1 for object "Bar" + // expecting two MIME parts: []byte{0xAA, 0xBB} and []byte{0xDD} + + httpRequest, err = http.NewRequest("GET", urlPrefix+"TestAccount/TestContainer/Bar", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("Range", "bytes=0-1,3-3") + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusPartialContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + contentType = httpResponse.Header.Get("Content-Type") + contentTypeMultiPartBoundary = strings.TrimPrefix(contentType, "multipart/byteranges; boundary=") + if (len(contentType) == len(contentTypeMultiPartBoundary)) || (0 == len(contentTypeMultiPartBoundary)) { + t.Fatalf("httpReponse.Header[\"Content-Type\"] contained unexpected value: \"%v\"", contentType) + } + expectedBuf = make([]byte, 0, httpResponse.ContentLength) + expectedBuf = append(expectedBuf, []byte("--"+contentTypeMultiPartBoundary+"\r\n")...) + expectedBuf = append(expectedBuf, []byte("Content-Type: application/octet-stream\r\n")...) + expectedBuf = append(expectedBuf, []byte("Content-Range: bytes 0-1/5\r\n")...) + expectedBuf = append(expectedBuf, []byte("\r\n")...) + expectedBuf = append(expectedBuf, []byte{0xAA, 0xBB}...) + expectedBuf = append(expectedBuf, []byte("\r\n")...) + expectedBuf = append(expectedBuf, []byte("--"+contentTypeMultiPartBoundary+"\r\n")...) + expectedBuf = append(expectedBuf, []byte("Content-Type: application/octet-stream\r\n")...) + expectedBuf = append(expectedBuf, []byte("Content-Range: bytes 3-3/5\r\n")...) + expectedBuf = append(expectedBuf, []byte("\r\n")...) + expectedBuf = append(expectedBuf, []byte{0xDD}...) + expectedBuf = append(expectedBuf, []byte("\r\n")...) + expectedBuf = append(expectedBuf, []byte("--"+contentTypeMultiPartBoundary+"--")...) + if int64(len(expectedBuf)) != httpResponse.ContentLength { + t.Fatalf("Unexpected multi-part GET response Content-Length") + } + readBuf, err = ioutil.ReadAll(httpResponse.Body) + if nil != err { + t.Fatalf("ioutil.ReadAll() returned unexpected error: %v", err) + } + if 0 != bytes.Compare(expectedBuf, readBuf) { + t.Fatalf("Unexpected payload of multi-part GET response") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a tail GET of the last 2 bytes for object "Bar" expecting []byte{0xDD, 0xEE} + + httpRequest, err = http.NewRequest("GET", urlPrefix+"TestAccount/TestContainer/Bar", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("Range", "bytes=-2") + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusPartialContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if int64(len([]byte{0xDD, 0xEE})) != httpResponse.ContentLength { + t.Fatalf("Bar's last 2 bytes should contain precisely []byte{0xDD, 0xEE}") + } + readBuf, err = ioutil.ReadAll(httpResponse.Body) + if nil != err { + t.Fatalf("ioutil.ReadAll() returned unexpected error: %v", err) + } + if 0 != bytes.Compare([]byte{0xDD, 0xEE}, readBuf) { + t.Fatalf("Bar's last 2 bytes should contain precisely []byte{0xDD, 0xEE}") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a PUT for object "ZigZag" and header Cat: Dog + + httpRequest, err = http.NewRequest("PUT", urlPrefix+"TestAccount/TestContainer/ZigZag", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("Cat", "Dog") + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusCreated != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a HEAD for object "ZigZag" expecting header Cat: Dog + + httpRequest, err = http.NewRequest("HEAD", urlPrefix+"TestAccount/TestContainer/ZigZag", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusOK != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestAccount should have header Cat: Dog") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a HEAD for object "ZigZag" expecting header Cat: Dog + + httpRequest, err = http.NewRequest("HEAD", urlPrefix+"TestAccount/TestContainer/ZigZag", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusOK != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestAccount should have header Cat: Dog") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a POST for object "ZigZag" and header Mouse: Bird + + httpRequest, err = http.NewRequest("POST", urlPrefix+"TestAccount/TestContainer/ZigZag", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("Mouse", "Bird") + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a HEAD for object "ZigZag" expecting header Cat: Dog & Mouse: Bird + + httpRequest, err = http.NewRequest("HEAD", urlPrefix+"TestAccount/TestContainer/ZigZag", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusOK != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestAccount should have header Cat: Dog") + } + if httpResponse.Header.Get("Mouse") != "Bird" { + t.Fatalf("TestAccount should have header Mouse: Bird") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a POST for object "ZigZag" deleting header Mouse + + httpRequest, err = http.NewRequest("POST", urlPrefix+"TestAccount/TestContainer/ZigZag", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("Mouse", "") + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a HEAD for object "ZigZag" expecting header Cat: Dog & no Mouse header + + httpRequest, err = http.NewRequest("HEAD", urlPrefix+"TestAccount/TestContainer/ZigZag", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusOK != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestAccount should have header Cat: Dog") + } + _, mouseHeaderPresent = httpResponse.Header["Mouse"] + if mouseHeaderPresent { + t.Fatalf("TestAccount should not have header Mouse") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a DELETE for object "Foo" + + httpRequest, err = http.NewRequest("DELETE", urlPrefix+"TestAccount/TestContainer/Foo", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a DELETE for object "Bar" + + httpRequest, err = http.NewRequest("DELETE", urlPrefix+"TestAccount/TestContainer/Bar", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a DELETE for object "ZigZag" + + httpRequest, err = http.NewRequest("DELETE", urlPrefix+"TestAccount/TestContainer/ZigZag", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a GET for container "TestContainer" expecting Content-Length: 0 and header Cat: Dog + + httpRequest, err = http.NewRequest("GET", urlPrefix+"TestAccount/TestContainer", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestContainer should have header Cat: Dog") + } + if 0 != httpResponse.ContentLength { + t.Fatalf("TestContainer should contain no elements at this point") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a DELETE for container "TestContainer" + + httpRequest, err = http.NewRequest("DELETE", urlPrefix+"TestAccount/TestContainer", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a GET for account "TestAccount" expecting Content-Length: 0 and header Cat: Dog + + httpRequest, err = http.NewRequest("GET", urlPrefix+"TestAccount", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Cat") != "Dog" { + t.Fatalf("TestAccount should have header Cat: Dog") + } + if 0 != httpResponse.ContentLength { + t.Fatalf("TestAccount should contain no elements at this point") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a DELETE for account "TestAccount" + + httpRequest, err = http.NewRequest("DELETE", urlPrefix+"TestAccount", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + err = Stop() + if nil != err { + t.Fatalf("Stop() returned unexpected error: %v", err) + } +} diff --git a/emswift/main.go b/emswift/main.go index ed6b83fc9..94a14a148 100644 --- a/emswift/main.go +++ b/emswift/main.go @@ -38,15 +38,6 @@ func main() { os.Exit(1) } - // Arm signal handler used to indicate termination and wait on it - // - // Note: signalled chan must be buffered to avoid race with window between - // arming handler and blocking on the chan read - - signalChan = make(chan os.Signal, 1) - - signal.Notify(signalChan, unix.SIGINT, unix.SIGTERM, unix.SIGHUP) - // Start Swift Emulation err = emswiftpkg.Start(confMap) @@ -55,13 +46,20 @@ func main() { os.Exit(1) } - // Await any of the above specified signals + // Arm signal handler used to indicate termination & wait on it + // + // Note: signal'd chan must be buffered to avoid race with window between + // arming handler and blocking on the chan read + + signalChan = make(chan os.Signal, 1) + + signal.Notify(signalChan, unix.SIGINT, unix.SIGTERM, unix.SIGHUP) _ = <-signalChan // Stop Swift Emulation - emswiftpkg.Stop() + err = emswiftpkg.Stop() if nil != err { fmt.Fprintf(os.Stderr, "emswiftpkg.Stop() failed: %v\n", err) os.Exit(1) From 57384f2f786302b5c50fad68d17cccd510c06911 Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Tue, 26 Jan 2021 14:18:33 -0800 Subject: [PATCH 013/160] Fixed startup of NoAuthEmulator and got NoAuthEmulation to pass pkg_test.go ported from package ramswift --- emswift/emswiftpkg/impl.go | 59 ++++++++++++++++++++++++++++++++-- emswift/emswiftpkg/pkg_test.go | 5 +++ 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/emswift/emswiftpkg/impl.go b/emswift/emswiftpkg/impl.go index 3ab3ea7d8..6aa756a41 100644 --- a/emswift/emswiftpkg/impl.go +++ b/emswift/emswiftpkg/impl.go @@ -13,6 +13,7 @@ import ( "strings" "sync" "syscall" + "time" "golang.org/x/sys/unix" @@ -76,6 +77,11 @@ type globalsStruct struct { var globals globalsStruct +const ( + startGETInfoMaxRetries = 10 + startGETInfoRetryDelay = 100 * time.Millisecond +) + type httpRequestHandler struct{} type rangeStruct struct { @@ -195,7 +201,8 @@ func uninitializeGlobals() { func startAuthIfRequested() (err error) { var ( - authEmulator *authEmulatorStruct + authEmulator *authEmulatorStruct + startGETInfoNumRetries int ) if "" == globals.config.AuthIPAddr { @@ -220,6 +227,22 @@ func startAuthIfRequested() (err error) { globals.authEmulator.wg.Done() }() + startGETInfoNumRetries = 0 + + for { + _, err = http.Get("http://" + globals.authEmulator.httpServer.Addr + "/info") + if nil == err { + break + } + startGETInfoNumRetries++ + if startGETInfoNumRetries > startGETInfoMaxRetries { + _ = stopAuthIfRequested() + err = fmt.Errorf("startAuthIfRequested() failed to establish that authEmulator is up") + return + } + time.Sleep(startGETInfoRetryDelay) + } + err = nil return } @@ -244,7 +267,8 @@ func stopAuthIfRequested() (err error) { func startNoAuth() (err error) { var ( - noAuthEmulator *noAuthEmulatorStruct + noAuthEmulator *noAuthEmulatorStruct + startGETInfoNumRetries int ) noAuthEmulator = &noAuthEmulatorStruct{ @@ -263,6 +287,22 @@ func startNoAuth() (err error) { globals.noAuthEmulator.wg.Done() }() + startGETInfoNumRetries = 0 + + for { + _, err = http.Get("http://" + globals.noAuthEmulator.httpServer.Addr + "/info") + if nil == err { + break + } + startGETInfoNumRetries++ + if startGETInfoNumRetries > startGETInfoMaxRetries { + _ = stopNoAuth() + err = fmt.Errorf("startNoAuth() failed to establish that noAuthEmulator is up") + return + } + time.Sleep(startGETInfoRetryDelay) + } + err = nil return } @@ -285,7 +325,20 @@ func (dummy *authEmulatorStruct) ServeHTTP(responseWriter http.ResponseWriter, r } func (dummy *noAuthEmulatorStruct) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) { - // TODO + switch request.Method { + case http.MethodDelete: + doNoAuthDELETE(responseWriter, request) + case http.MethodGet: + doNoAuthGET(responseWriter, request) + case http.MethodHead: + doNoAuthHEAD(responseWriter, request) + case http.MethodPost: + doNoAuthPOST(responseWriter, request) + case http.MethodPut: + doNoAuthPUT(responseWriter, request) + default: + responseWriter.WriteHeader(http.StatusMethodNotAllowed) + } } func (dummy *globalsStruct) DumpKey(key sortedmap.Key) (keyAsString string, err error) { diff --git a/emswift/emswiftpkg/pkg_test.go b/emswift/emswiftpkg/pkg_test.go index a19ad55d8..d7faae864 100644 --- a/emswift/emswiftpkg/pkg_test.go +++ b/emswift/emswiftpkg/pkg_test.go @@ -89,6 +89,11 @@ func TestNoAuthEmulation(t *testing.T) { t.Fatalf("Start(confMap) returned unexpected error: %v", err) } + // Format URLs + + urlForInfo = "http://" + globals.noAuthEmulator.httpServer.Addr + "/info" + urlPrefix = "http://" + globals.noAuthEmulator.httpServer.Addr + "/v1/" + // Setup http.Client that we will use for all HTTP requests httpClient = &http.Client{} From d990df58f4320374bbeb586f88ec18e0ddc4d6d9 Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Tue, 26 Jan 2021 15:41:33 -0800 Subject: [PATCH 014/160] Implemented non-RPC portion of emswift AuthEmulation --- emswift/emswift.conf | 4 +- emswift/emswiftpkg/impl.go | 286 ++++++++++--------------------------- 2 files changed, 76 insertions(+), 214 deletions(-) diff --git a/emswift/emswift.conf b/emswift/emswift.conf index 7bbdf9f28..dabf7f0a5 100644 --- a/emswift/emswift.conf +++ b/emswift/emswift.conf @@ -2,8 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 [EMSWIFT] -AuthIPAddr: # 0.0.0.0 -AuthTCPPort: # 8080 +AuthIPAddr: 127.0.0.1 # If AuthIPAddr left blank or missing, +AuthTCPPort: 8080 # AuthTCPPort is ignored and no AuthEmulator is launched NoAuthIPAddr: 127.0.0.1 NoAuthTCPPort: 8090 diff --git a/emswift/emswiftpkg/impl.go b/emswift/emswiftpkg/impl.go index 6aa756a41..5d53638f3 100644 --- a/emswift/emswiftpkg/impl.go +++ b/emswift/emswiftpkg/impl.go @@ -82,6 +82,11 @@ const ( startGETInfoRetryDelay = 100 * time.Millisecond ) +const ( + fixedAuthToken = "AUTH_tk0123456789abcde0123456789abcdef0" + fixedUserToAccountPrefix = "AUTH_" // Prefixed to User truncated before colon (":") if necessary +) + type httpRequestHandler struct{} type rangeStruct struct { @@ -321,7 +326,75 @@ func stopNoAuth() (err error) { } func (dummy *authEmulatorStruct) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) { - // TODO + var ( + noAuthPath string + xAuthKey string + xAuthUser string + xAuthUserSplit2OnColon []string + xStorageURL string + ) + + // Handle the GET of/on info & AuthURL cases + + if http.MethodGet == request.Method { + switch request.URL.Path { + case "/info": + _ = request.Body.Close() + doNoAuthGET(responseWriter, request) + return + case "/auth/v1.0": + _ = request.Body.Close() + xAuthUser = request.Header.Get("X-Auth-User") + xAuthKey = request.Header.Get("X-Auth-Key") + if ("" == xAuthUser) || ("" == xAuthKey) { + responseWriter.WriteHeader(http.StatusUnauthorized) + return + } + xAuthUserSplit2OnColon = strings.SplitN(xAuthUser, ":", 2) + xStorageURL = "http://" + globals.authEmulator.httpServer.Addr + "/v1/" + fixedUserToAccountPrefix + xAuthUserSplit2OnColon[0] + responseWriter.Header().Add("X-Auth-Token", fixedAuthToken) + responseWriter.Header().Add("X-Storage-Url", xStorageURL) + return + default: + // Fall through to normal processing + } + } + + // Require X-Auth-Token to match fixedAuthToken + + if fixedAuthToken != request.Header.Get("X-Auth-Token") { + _ = request.Body.Close() + responseWriter.WriteHeader(http.StatusUnauthorized) + return + } + + // Require "version" portion of request.URL.Path to be "proxyfs" + + if !strings.HasPrefix(request.URL.Path, "/proxyfs/") { + _ = request.Body.Close() + responseWriter.WriteHeader(http.StatusNotFound) + return + } + + // Branch off to individual request method handlers + + switch request.Method { + case http.MethodGet: + noAuthPath = strings.Replace(request.URL.Path, "proxyfs", "v1", 1) + request.URL.Path = noAuthPath + doNoAuthGET(responseWriter, request) + case http.MethodPut: + noAuthPath = strings.Replace(request.URL.Path, "proxyfs", "v1", 1) + request.URL.Path = noAuthPath + doNoAuthPUT(responseWriter, request) + case "PROXYFS": + // TODO: doRPC(responseWriter, request) + _ = request.Body.Close() + responseWriter.WriteHeader(http.StatusNotImplemented) + return + default: + responseWriter.WriteHeader(http.StatusMethodNotAllowed) + } } func (dummy *noAuthEmulatorStruct) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) { @@ -1382,214 +1455,3 @@ func doNoAuthPUT(responseWriter http.ResponseWriter, request *http.Request) { } } } - -/* -func (h httpRequestHandler) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) { - switch request.Method { - case http.MethodDelete: - doNoAuthDELETE(responseWriter, request) - case http.MethodGet: - doNoAuthGET(responseWriter, request) - case http.MethodHead: - doNoAuthHEAD(responseWriter, request) - case http.MethodPost: - doNoAuthPOST(responseWriter, request) - case http.MethodPut: - doNoAuthPUT(responseWriter, request) - default: - responseWriter.WriteHeader(http.StatusMethodNotAllowed) - } -} - -func setupNoAuthSwift(confMap conf.ConfMap) { - var ( - err error - errno syscall.Errno - primaryPeerList []string - swiftAccountName string - volumeGroupNameList []string - volumeGroupName string - volumeGroupSectionName string - volumeName string - volumeNameList []string - volumeSectionName string - ) - - // Fetch and configure volumes for which "we" are the PrimaryPeer - - volumeGroupNameList, err = confMap.FetchOptionValueStringSlice("FSGlobals", "VolumeGroupList") - if nil != err { - log.Fatalf("failed fetch of FSGlobals.VolumeGroupList: %v", err) - } - - for _, volumeGroupName = range volumeGroupNameList { - volumeGroupSectionName = "VolumeGroup:" + volumeGroupName - - primaryPeerList, err = confMap.FetchOptionValueStringSlice(volumeGroupSectionName, "PrimaryPeer") - if nil != err { - log.Fatalf("failed fetch of %v.PrimaryPeer: %v", volumeGroupSectionName, err) - } - if 0 == len(primaryPeerList) { - continue - } else if 1 == len(primaryPeerList) { - if globals.whoAmI != primaryPeerList[0] { - continue - } - } else { - log.Fatalf("fetch of %v.PrimaryPeer returned multiple values", volumeGroupSectionName) - } - - volumeNameList, err = confMap.FetchOptionValueStringSlice(volumeGroupSectionName, "VolumeList") - if nil != err { - log.Fatalf("failed fetch of %v.VolumeList: %v", volumeGroupSectionName, err) - } - - for _, volumeName = range volumeNameList { - volumeSectionName = "Volume:" + volumeName - - swiftAccountName, err = confMap.FetchOptionValueString(volumeSectionName, "AccountName") - if nil != err { - log.Fatalf("failed fetch of %v.AccountName: %v", volumeSectionName, err) - } - - _, errno = createSwiftAccount(swiftAccountName) - if 0 != errno { - log.Fatalf("failed create of %v: %v", swiftAccountName, err) - } - } - } - - // Create HTTP Server on the requested noAuthTCPPort - - globals.noAuthHTTPServer = &http.Server{ - Addr: globals.noAuthAddr, - Handler: httpRequestHandler{}, - } -} - -func serveNoAuthSwift() { - _ = globals.noAuthHTTPServer.ListenAndServe() - - globals.noAuthHTTPServerWG.Done() -} - -func Daemon(confFile string, confStrings []string, signalHandlerIsArmedWG *sync.WaitGroup, doneChan chan bool, signals ...os.Signal) { - var ( - confMap conf.ConfMap - err error - resp *http.Response - signalChan chan os.Signal - signalReceived os.Signal - ) - - // Initialization - - globals = &globalsStruct{} - - globals.swiftAccountMap = make(map[string]*swiftAccountStruct) - - // Compute confMap - - confMap, err = conf.MakeConfMapFromFile(confFile) - if nil != err { - log.Fatalf("failed to load config: %v", err) - } - - err = confMap.UpdateFromStrings(confStrings) - if nil != err { - log.Fatalf("failed to apply config overrides: %v", err) - } - - err = transitions.UpgradeConfMapIfNeeded(confMap) - if nil != err { - log.Fatalf("failed to upgrade confMap: %v", err) - } - - // Find out who "we" are - - globals.whoAmI, err = confMap.FetchOptionValueString("Cluster", "WhoAmI") - if nil != err { - log.Fatalf("failed fetch of Cluster.WhoAmI: %v", err) - } - - globals.noAuthTCPPort, err = confMap.FetchOptionValueUint16("SwiftClient", "NoAuthTCPPort") - if nil != err { - log.Fatalf("failed fetch of Swift.NoAuthTCPPort: %v", err) - } - - globals.noAuthAddr = "127.0.0.1:" + strconv.Itoa(int(globals.noAuthTCPPort)) - - // Kick off NoAuth Swift Proxy Emulator - - setupNoAuthSwift(confMap) - globals.noAuthHTTPServerWG.Add(1) - go serveNoAuthSwift() - - // Wait for serveNoAuthSwift() to begin serving - - for { - resp, err = http.Get("http://" + globals.noAuthAddr + "/info") - if nil != err { - log.Printf("failed GET of \"/info\": %v", err) - continue - } - if http.StatusOK == resp.StatusCode { - break - } - log.Printf("GET of \"/info\" returned Status %v", resp.Status) - time.Sleep(100 * time.Millisecond) - } - - // Arm signal handler used to indicate termination and wait on it - // - // Note: signalled chan must be buffered to avoid race with window between - // arming handler and blocking on the chan read - - signalChan = make(chan os.Signal, 1) - - signal.Notify(signalChan, signals...) - - if nil != signalHandlerIsArmedWG { - signalHandlerIsArmedWG.Done() - } - - // Await a signal - reloading confFile each SIGHUP - exiting otherwise - - for { - signalReceived = <-signalChan - - if unix.SIGHUP == signalReceived { - // recompute confMap and re-apply - - confMap, err = conf.MakeConfMapFromFile(confFile) - if nil != err { - log.Fatalf("failed to load updated config: %v", err) - } - - err = confMap.UpdateFromStrings(confStrings) - if nil != err { - log.Fatalf("failed to reapply config overrides: %v", err) - } - - err = transitions.UpgradeConfMapIfNeeded(confMap) - if nil != err { - log.Fatalf("failed to upgrade confMap: %v", err) - } - - updateConf(confMap) - } else { - // signalReceived either SIGINT or SIGTERM... so just exit - - err = globals.noAuthHTTPServer.Close() - - globals.noAuthHTTPServerWG.Wait() - - globals = nil - - doneChan <- true - - return - } - } -} -*/ From 3c95fea25ec517d73c62f7e4d3e93616b6356130 Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Wed, 27 Jan 2021 08:40:40 -0800 Subject: [PATCH 015/160] Added non-functional PROXYFS->JSON-RPC hooks to emswift --- emswift/emswift.conf | 3 + emswift/emswiftpkg/impl.go | 42 +++++++++- emswift/emswiftpkg/pkg_test.go | 147 ++++++++++++++++++++++++++++++++- 3 files changed, 184 insertions(+), 8 deletions(-) diff --git a/emswift/emswift.conf b/emswift/emswift.conf index dabf7f0a5..d36206bfc 100644 --- a/emswift/emswift.conf +++ b/emswift/emswift.conf @@ -5,6 +5,9 @@ AuthIPAddr: 127.0.0.1 # If AuthIPAddr left blank or missing, AuthTCPPort: 8080 # AuthTCPPort is ignored and no AuthEmulator is launched +JRPCIPAddr: 127.0.0.1 # If AuthIPAddr left blank or missing, +JRPCTCPPort: 12345 # JRPC{IPAddr|TCPPort} are ignored + NoAuthIPAddr: 127.0.0.1 NoAuthTCPPort: 8090 diff --git a/emswift/emswiftpkg/impl.go b/emswift/emswiftpkg/impl.go index 5d53638f3..03eaa542a 100644 --- a/emswift/emswiftpkg/impl.go +++ b/emswift/emswiftpkg/impl.go @@ -47,6 +47,9 @@ type configStruct struct { AuthIPAddr string // Only required if Auth Swift Proxy enabled AuthTCPPort uint16 // Only required if Auth Swift Proxy enabled + JRPCIPAddr string // Only required if Auth Swift Proxy enabled + JRPCTCPPort uint16 // Only required if Auth Swift Proxy enabled + NoAuthIPAddr string NoAuthTCPPort uint16 @@ -87,6 +90,25 @@ const ( fixedUserToAccountPrefix = "AUTH_" // Prefixed to User truncated before colon (":") if necessary ) +type jrpcRequestStruct struct { + JSONrpc string `json:"jsonrpc"` + Method string `json:"method"` + ID uint64 `json:"id"` + Params [1]interface{} `json:"params"` +} + +type jrpcRequestEmptyParamStruct struct{} + +type jrpcResponseIDAndErrorStruct struct { + ID uint64 `json:"id"` + Error string `json:"error"` +} + +type jrpcResponseNoErrorStruct struct { + ID uint64 `json:"id"` + Result interface{} `json:"result"` +} + type httpRequestHandler struct{} type rangeStruct struct { @@ -141,6 +163,15 @@ func initializeGlobals(confMap conf.ConfMap) (err error) { if nil != err { return } + + globals.config.JRPCIPAddr, err = confMap.FetchOptionValueString("EMSWIFT", "JRPCIPAddr") + if nil != err { + return + } + globals.config.JRPCTCPPort, err = confMap.FetchOptionValueUint16("EMSWIFT", "JRPCTCPPort") + if nil != err { + return + } } else { err = nil globals.config.AuthIPAddr = "" @@ -388,15 +419,18 @@ func (dummy *authEmulatorStruct) ServeHTTP(responseWriter http.ResponseWriter, r request.URL.Path = noAuthPath doNoAuthPUT(responseWriter, request) case "PROXYFS": - // TODO: doRPC(responseWriter, request) - _ = request.Body.Close() - responseWriter.WriteHeader(http.StatusNotImplemented) - return + doAuthPROXYFS(responseWriter, request) default: responseWriter.WriteHeader(http.StatusMethodNotAllowed) } } +func doAuthPROXYFS(responseWriter http.ResponseWriter, request *http.Request) { + fmt.Println("TODO: doAuthPROXYFS(responseWriter, request)") + _ = request.Body.Close() + responseWriter.WriteHeader(http.StatusNotImplemented) +} + func (dummy *noAuthEmulatorStruct) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) { switch request.Method { case http.MethodDelete: diff --git a/emswift/emswiftpkg/pkg_test.go b/emswift/emswiftpkg/pkg_test.go index d7faae864..56172d98d 100644 --- a/emswift/emswiftpkg/pkg_test.go +++ b/emswift/emswiftpkg/pkg_test.go @@ -5,22 +5,32 @@ package emswiftpkg import ( "bytes" + "fmt" "io" "io/ioutil" + "net" "net/http" "strings" + "sync" "testing" "github.com/swiftstack/ProxyFS/conf" "github.com/swiftstack/ProxyFS/utils" ) +type testJRPCServerHandlerStruct struct { + httpServer *http.Server + wg sync.WaitGroup +} + func TestAuthEmulation(t *testing.T) { var ( confMap conf.ConfMap confStrings = []string{ "EMSWIFT.AuthIPAddr=127.0.0.1", - "EMSWIFT.AuthTCPPort=9998", + "EMSWIFT.AuthTCPPort=9997", + "EMSWIFT.JRPCIPAddr=127.0.0.1", + "EMSWIFT.JRPCTCPPort=9998", "EMSWIFT.NoAuthIPAddr=127.0.0.1", "EMSWIFT.NoAuthTCPPort=9999", "EMSWIFT.MaxAccountNameLength=256", @@ -29,7 +39,17 @@ func TestAuthEmulation(t *testing.T) { "EMSWIFT.AccountListingLimit=10000", "EMSWIFT.ContainerListingLimit=10000", } - err error + err error + expectedInfo string + expectedStorageURL string + httpClient *http.Client + httpRequest *http.Request + httpResponse *http.Response + readBuf []byte + testJRPCServerHandler *testJRPCServerHandlerStruct + urlForAuth string + urlForInfo string + urlPrefix string ) confMap, err = conf.MakeConfMapFromStrings(confStrings) @@ -42,7 +62,122 @@ func TestAuthEmulation(t *testing.T) { t.Fatalf("Start(confMap) returned unexpected error: %v", err) } - t.Logf("TODO: Implement TestAuthEmulation() test steps") + testJRPCServerHandler = &testJRPCServerHandlerStruct{ + httpServer: &http.Server{ + Addr: net.JoinHostPort(globals.config.JRPCIPAddr, fmt.Sprintf("%d", globals.config.JRPCTCPPort)), + }, + } + testJRPCServerHandler.httpServer.Handler = testJRPCServerHandler + + // Format URLs + + urlForInfo = "http://" + globals.authEmulator.httpServer.Addr + "/info" + urlForAuth = "http://" + globals.authEmulator.httpServer.Addr + "/auth/v1.0" + urlPrefix = "http://" + globals.authEmulator.httpServer.Addr + "/proxyfs/" + + expectedStorageURL = "http://" + globals.authEmulator.httpServer.Addr + "/v1/" + "AUTH_test" + + // Setup http.Client that we will use for all HTTP requests + + httpClient = &http.Client{} + + // Send a GET for "/info" expecting [EMSWIFT] data in compact JSON form + + httpRequest, err = http.NewRequest("GET", urlForInfo, nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusOK != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + expectedInfo = "{\"swift\": {\"max_account_name_length\": 256,\"max_container_name_length\": 256,\"max_object_name_length\": 1024,\"account_listing_limit\": 10000,\"container_listing_limit\": 10000}}" + if int64(len(expectedInfo)) != httpResponse.ContentLength { + t.Fatalf("GET of /info httpResponse.ContentLength unexpected") + } + readBuf, err = ioutil.ReadAll(httpResponse.Body) + if nil != err { + t.Fatalf("ioutil.ReadAll() returned unexpected error: %v", err) + } + if expectedInfo != utils.ByteSliceToString(readBuf) { + t.Fatalf("GET of /info httpResponse.Body contents unexpected") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a GET for "/auth/v1.0" expecting X-Auth-Token & X-Storage-Url + + httpRequest, err = http.NewRequest("GET", urlForAuth, nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("X-Auth-User", "test:tester") + httpRequest.Header.Add("X-Auth-Key", "testing") + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusOK != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + if httpResponse.Header.Get("X-Auth-Token") != fixedAuthToken { + t.Fatalf("Auth response should have header X-Auth-Token: %s", fixedAuthToken) + } + if httpResponse.Header.Get("X-Storage-Url") != expectedStorageURL { + t.Fatalf("Auth response should have header X-Storage-Url: %s", expectedStorageURL) + } + + // Send a PUT for account "TestAccount" + + httpRequest, err = http.NewRequest("PUT", urlPrefix+"TestAccount", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("X-Auth-Token", fixedAuthToken) + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusCreated != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + // Send a GET for account "TestAccount" expecting Content-Length: 0 + + httpRequest, err = http.NewRequest("GET", urlPrefix+"TestAccount", nil) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("X-Auth-Token", fixedAuthToken) + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusNoContent != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if 0 != httpResponse.ContentLength { + t.Fatalf("TestAccount should contain no elements at this point") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } + + t.Logf("TODO: Implement remaining TestAuthEmulation() PROXYFS RPC Method") err = Stop() if nil != err { @@ -50,6 +185,10 @@ func TestAuthEmulation(t *testing.T) { } } +func testAuthEmulationJRPCServer() { + // TODO +} + func TestNoAuthEmulation(t *testing.T) { var ( confMap conf.ConfMap @@ -98,7 +237,7 @@ func TestNoAuthEmulation(t *testing.T) { httpClient = &http.Client{} - // Send a GET for "/info" expecting [RamSwiftInfo] data in compact JSON form + // Send a GET for "/info" expecting [EMSWIFT] data in compact JSON form httpRequest, err = http.NewRequest("GET", urlForInfo, nil) if nil != err { From f454a2da217f5a1f43fee408c96987a53317e62d Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Wed, 27 Jan 2021 10:29:18 -0800 Subject: [PATCH 016/160] emswiftpkg now supports PROXYFS JSON-RPC traffic... just missing a simple "echo" test for it --- emswift/emswiftpkg/impl.go | 105 +++++++++++++++++++++++++++-- emswift/emswiftpkg/pkg_test.go | 119 ++++++++++++++++++++++++++------- 2 files changed, 195 insertions(+), 29 deletions(-) diff --git a/emswift/emswiftpkg/impl.go b/emswift/emswiftpkg/impl.go index 03eaa542a..4e8fde1de 100644 --- a/emswift/emswiftpkg/impl.go +++ b/emswift/emswiftpkg/impl.go @@ -61,17 +61,19 @@ type configStruct struct { } type authEmulatorStruct struct { - httpServer *http.Server - wg sync.WaitGroup + sync.Mutex + httpServer *http.Server + resolvedJRPCTCPAddr *net.TCPAddr + wg sync.WaitGroup } type noAuthEmulatorStruct struct { + sync.Mutex httpServer *http.Server wg sync.WaitGroup } type globalsStruct struct { - sync.Mutex config configStruct authEmulator *authEmulatorStruct noAuthEmulator *noAuthEmulatorStruct @@ -254,6 +256,11 @@ func startAuthIfRequested() (err error) { } authEmulator.httpServer.Handler = authEmulator + authEmulator.resolvedJRPCTCPAddr, err = net.ResolveTCPAddr("tcp", net.JoinHostPort(globals.config.JRPCIPAddr, fmt.Sprintf("%d", globals.config.JRPCTCPPort))) + if nil != err { + return + } + authEmulator.wg.Add(1) globals.authEmulator = authEmulator @@ -426,9 +433,82 @@ func (dummy *authEmulatorStruct) ServeHTTP(responseWriter http.ResponseWriter, r } func doAuthPROXYFS(responseWriter http.ResponseWriter, request *http.Request) { - fmt.Println("TODO: doAuthPROXYFS(responseWriter, request)") + var ( + bytesWritten int + bytesWrittenInTotal int + err error + jrpcRequest []byte + jrpcResponse []byte + jrpcResponseNestedLeftBraces uint32 + jrpcResponseSingleByte []byte + jrpcTCPConn *net.TCPConn + ) + + globals.authEmulator.Lock() + defer globals.authEmulator.Unlock() + + jrpcRequest, err = ioutil.ReadAll(request.Body) + if nil != err { + panic(err) + } _ = request.Body.Close() - responseWriter.WriteHeader(http.StatusNotImplemented) + + jrpcTCPConn, err = net.DialTCP("tcp", nil, globals.authEmulator.resolvedJRPCTCPAddr) + if nil != err { + panic(err) + } + + bytesWrittenInTotal = 0 + + for bytesWrittenInTotal < len(jrpcRequest) { + bytesWritten, err = jrpcTCPConn.Write(jrpcRequest[len(jrpcRequest)-bytesWrittenInTotal:]) + if nil != err { + panic(err) + } + bytesWrittenInTotal += bytesWritten + } + + jrpcResponse = make([]byte, 0) + jrpcResponseSingleByte = make([]byte, 1) + + _, err = jrpcTCPConn.Read(jrpcResponseSingleByte) + if nil != err { + panic(err) + } + jrpcResponse = append(jrpcResponse, jrpcResponseSingleByte[0]) + + if '{' != jrpcResponseSingleByte[0] { + err = fmt.Errorf("Opening character of jrpcResponse must be '{'") + panic(err) + } + + jrpcResponseNestedLeftBraces = 1 + + for 0 < jrpcResponseNestedLeftBraces { + _, err = jrpcTCPConn.Read(jrpcResponseSingleByte) + if nil != err { + panic(err) + } + jrpcResponse = append(jrpcResponse, jrpcResponseSingleByte[0]) + + switch jrpcResponseSingleByte[0] { + case '{': + jrpcResponseNestedLeftBraces++ + case '}': + jrpcResponseNestedLeftBraces-- + default: + // Nothing special to do here + } + } + + err = jrpcTCPConn.Close() + if nil != err { + panic(err) + } + + responseWriter.Header().Add("Content-Type", "application/json") + responseWriter.WriteHeader(http.StatusOK) + _, _ = responseWriter.Write(jrpcResponse) } func (dummy *noAuthEmulatorStruct) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) { @@ -886,6 +966,9 @@ func doNoAuthDELETE(responseWriter http.ResponseWriter, request *http.Request) { swiftObjectName string ) + globals.noAuthEmulator.Lock() + defer globals.noAuthEmulator.Unlock() + infoOnly, swiftAccountName, swiftContainerName, swiftObjectName = parsePath(request) if infoOnly || ("" == swiftAccountName) { responseWriter.WriteHeader(http.StatusForbidden) @@ -986,6 +1069,9 @@ func doNoAuthGET(responseWriter http.ResponseWriter, request *http.Request) { swiftObjectNameAsKey sortedmap.Key ) + globals.noAuthEmulator.Lock() + defer globals.noAuthEmulator.Unlock() + infoOnly, swiftAccountName, swiftContainerName, swiftObjectName = parsePath(request) if infoOnly { _, _ = responseWriter.Write(utils.StringToByteSlice("{")) @@ -1178,6 +1264,9 @@ func doNoAuthHEAD(responseWriter http.ResponseWriter, request *http.Request) { swiftObjectName string ) + globals.noAuthEmulator.Lock() + defer globals.noAuthEmulator.Unlock() + infoOnly, swiftAccountName, swiftContainerName, swiftObjectName = parsePath(request) if infoOnly || ("" == swiftAccountName) { responseWriter.WriteHeader(http.StatusForbidden) @@ -1259,6 +1348,9 @@ func doNoAuthPOST(responseWriter http.ResponseWriter, request *http.Request) { swiftObjectName string ) + globals.noAuthEmulator.Lock() + defer globals.noAuthEmulator.Unlock() + infoOnly, swiftAccountName, swiftContainerName, swiftObjectName = parsePath(request) if infoOnly || ("" == swiftAccountName) { responseWriter.WriteHeader(http.StatusForbidden) @@ -1376,6 +1468,9 @@ func doNoAuthPUT(responseWriter http.ResponseWriter, request *http.Request) { wasCreated bool ) + globals.noAuthEmulator.Lock() + defer globals.noAuthEmulator.Unlock() + infoOnly, swiftAccountName, swiftContainerName, swiftObjectName = parsePath(request) if infoOnly || ("" == swiftAccountName) { responseWriter.WriteHeader(http.StatusForbidden) diff --git a/emswift/emswiftpkg/pkg_test.go b/emswift/emswiftpkg/pkg_test.go index 56172d98d..e89f6cda3 100644 --- a/emswift/emswiftpkg/pkg_test.go +++ b/emswift/emswiftpkg/pkg_test.go @@ -5,7 +5,6 @@ package emswiftpkg import ( "bytes" - "fmt" "io" "io/ioutil" "net" @@ -18,11 +17,6 @@ import ( "github.com/swiftstack/ProxyFS/utils" ) -type testJRPCServerHandlerStruct struct { - httpServer *http.Server - wg sync.WaitGroup -} - func TestAuthEmulation(t *testing.T) { var ( confMap conf.ConfMap @@ -39,17 +33,18 @@ func TestAuthEmulation(t *testing.T) { "EMSWIFT.AccountListingLimit=10000", "EMSWIFT.ContainerListingLimit=10000", } - err error - expectedInfo string - expectedStorageURL string - httpClient *http.Client - httpRequest *http.Request - httpResponse *http.Response - readBuf []byte - testJRPCServerHandler *testJRPCServerHandlerStruct - urlForAuth string - urlForInfo string - urlPrefix string + err error + expectedInfo string + expectedStorageURL string + httpClient *http.Client + httpRequest *http.Request + httpResponse *http.Response + readBuf []byte + testJRPCServerHandlerTCPListener *net.TCPListener + testJRPCServerHandlerWG *sync.WaitGroup + urlForAuth string + urlForInfo string + urlPrefix string ) confMap, err = conf.MakeConfMapFromStrings(confStrings) @@ -62,12 +57,14 @@ func TestAuthEmulation(t *testing.T) { t.Fatalf("Start(confMap) returned unexpected error: %v", err) } - testJRPCServerHandler = &testJRPCServerHandlerStruct{ - httpServer: &http.Server{ - Addr: net.JoinHostPort(globals.config.JRPCIPAddr, fmt.Sprintf("%d", globals.config.JRPCTCPPort)), - }, + testJRPCServerHandlerTCPListener, err = net.ListenTCP("tcp", globals.authEmulator.resolvedJRPCTCPAddr) + if nil != err { + t.Fatalf("net.ListenTCP() returned unexpected error: %v", err) } - testJRPCServerHandler.httpServer.Handler = testJRPCServerHandler + + testJRPCServerHandlerWG = new(sync.WaitGroup) + testJRPCServerHandlerWG.Add(1) + go testJRPCServerHandler(testJRPCServerHandlerTCPListener, testJRPCServerHandlerWG) // Format URLs @@ -179,14 +176,88 @@ func TestAuthEmulation(t *testing.T) { t.Logf("TODO: Implement remaining TestAuthEmulation() PROXYFS RPC Method") + err = testJRPCServerHandlerTCPListener.Close() + if nil != err { + t.Fatalf("testJRPCServerHandlerTCPListener.Close() returned unexpected error: %v", err) + } + + testJRPCServerHandlerWG.Wait() + err = Stop() if nil != err { t.Fatalf("Stop() returned unexpected error: %v", err) } } -func testAuthEmulationJRPCServer() { - // TODO +func testJRPCServerHandler(testJRPCServerHandlerTCPListener *net.TCPListener, testJRPCServerHandlerWG *sync.WaitGroup) { + var ( + bytesWritten int + bytesWrittenInTotal int + err error + jrpcRequest []byte + jrpcRequestNestedLeftBraces uint32 + jrpcRequestSingleByte []byte + jrpcResponse []byte + jrpcTCPConn *net.TCPConn + ) + +DoAcceptTCP: + jrpcTCPConn, err = testJRPCServerHandlerTCPListener.AcceptTCP() + if nil != err { + testJRPCServerHandlerWG.Done() + return + } + + jrpcRequest = make([]byte, 0) + jrpcRequestSingleByte = make([]byte, 1) + + _, err = jrpcTCPConn.Read(jrpcRequestSingleByte) + if nil != err { + _ = jrpcTCPConn.Close() + goto DoAcceptTCP + } + jrpcRequest = append(jrpcRequest, jrpcRequestSingleByte[0]) + + if '{' != jrpcRequestSingleByte[0] { + _ = jrpcTCPConn.Close() + goto DoAcceptTCP + } + + jrpcRequestNestedLeftBraces = 1 + + for 0 < jrpcRequestNestedLeftBraces { + _, err = jrpcTCPConn.Read(jrpcRequestSingleByte) + if nil != err { + _ = jrpcTCPConn.Close() + goto DoAcceptTCP + } + jrpcRequest = append(jrpcRequest, jrpcRequestSingleByte[0]) + + switch jrpcRequestSingleByte[0] { + case '{': + jrpcRequestNestedLeftBraces++ + case '}': + jrpcRequestNestedLeftBraces-- + default: + // Nothing special to do here + } + } + + jrpcResponse = jrpcRequest + + bytesWrittenInTotal = 0 + + for bytesWrittenInTotal < len(jrpcResponse) { + bytesWritten, err = jrpcTCPConn.Write(jrpcResponse[len(jrpcResponse)-bytesWrittenInTotal:]) + if nil != err { + _ = jrpcTCPConn.Close() + goto DoAcceptTCP + } + bytesWrittenInTotal += bytesWritten + } + + _ = jrpcTCPConn.Close() + goto DoAcceptTCP } func TestNoAuthEmulation(t *testing.T) { From ae06288ba2b3c8943fca84141493f4d4d7e27fd5 Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Wed, 27 Jan 2021 10:53:32 -0800 Subject: [PATCH 017/160] Completed unit test of emswift --- emswift/emswiftpkg/impl.go | 2 +- emswift/emswiftpkg/pkg_test.go | 35 ++++++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/emswift/emswiftpkg/impl.go b/emswift/emswiftpkg/impl.go index 4e8fde1de..1473fb024 100644 --- a/emswift/emswiftpkg/impl.go +++ b/emswift/emswiftpkg/impl.go @@ -461,7 +461,7 @@ func doAuthPROXYFS(responseWriter http.ResponseWriter, request *http.Request) { bytesWrittenInTotal = 0 for bytesWrittenInTotal < len(jrpcRequest) { - bytesWritten, err = jrpcTCPConn.Write(jrpcRequest[len(jrpcRequest)-bytesWrittenInTotal:]) + bytesWritten, err = jrpcTCPConn.Write(jrpcRequest[bytesWrittenInTotal:]) if nil != err { panic(err) } diff --git a/emswift/emswiftpkg/pkg_test.go b/emswift/emswiftpkg/pkg_test.go index e89f6cda3..949b0fb56 100644 --- a/emswift/emswiftpkg/pkg_test.go +++ b/emswift/emswiftpkg/pkg_test.go @@ -174,7 +174,38 @@ func TestAuthEmulation(t *testing.T) { t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) } - t.Logf("TODO: Implement remaining TestAuthEmulation() PROXYFS RPC Method") + // Send a PROXYFS JSON-RPC "request" that simply gets echo'd + + httpRequest, err = http.NewRequest("PROXYFS", urlPrefix+"TestAccount", bytes.NewReader([]byte{'{', 'p', 'i', 'n', 'g', '}'})) + if nil != err { + t.Fatalf("http.NewRequest() returned unexpected error: %v", err) + } + httpRequest.Header.Add("X-Auth-Token", fixedAuthToken) + httpRequest.Header.Add("Content-Type", "application/json") + httpResponse, err = httpClient.Do(httpRequest) + if nil != err { + t.Fatalf("httpClient.Do() returned unexpected error: %v", err) + } + if http.StatusOK != httpResponse.StatusCode { + t.Fatalf("httpResponse.StatusCode contained unexpected value: %v", httpResponse.StatusCode) + } + if httpResponse.Header.Get("Content-Type") != "application/json" { + t.Fatalf("TestAccount should have header Content-Type: application/json") + } + if int64(len("{ping}")) != httpResponse.ContentLength { + t.Fatalf("TestContainer should contain only \"{ping}\"") + } + readBuf, err = ioutil.ReadAll(httpResponse.Body) + if nil != err { + t.Fatalf("ioutil.ReadAll() returned unexpected error: %v", err) + } + if "{ping}" != utils.ByteSliceToString(readBuf) { + t.Fatalf("TestContainer should contain only \"{ping}\"") + } + err = httpResponse.Body.Close() + if nil != err { + t.Fatalf("http.Response.Body.Close() returned unexpected error: %v", err) + } err = testJRPCServerHandlerTCPListener.Close() if nil != err { @@ -248,7 +279,7 @@ DoAcceptTCP: bytesWrittenInTotal = 0 for bytesWrittenInTotal < len(jrpcResponse) { - bytesWritten, err = jrpcTCPConn.Write(jrpcResponse[len(jrpcResponse)-bytesWrittenInTotal:]) + bytesWritten, err = jrpcTCPConn.Write(jrpcResponse[bytesWrittenInTotal:]) if nil != err { _ = jrpcTCPConn.Close() goto DoAcceptTCP From a43be90cbaf08959990f06c25631eb89a655decd Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Thu, 28 Jan 2021 13:59:24 -0800 Subject: [PATCH 018/160] Temporary work-around for SwiftStack Swift Fork in the process of moving... --- pfs_middleware/tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pfs_middleware/tox.ini b/pfs_middleware/tox.ini index 0e5c5a19e..d162fedc4 100644 --- a/pfs_middleware/tox.ini +++ b/pfs_middleware/tox.ini @@ -7,7 +7,7 @@ usedevelop = True deps = lint: flake8 !lint: -r{toxinidir}/test-requirements.txt - release: git+git://github.com/swiftstack/swift.git@ss-release-2.26.0.10 + release: git+git://github.com/openstack/swift.git@2.25.1 minver: http://tarballs.openstack.org/swift/swift-2.9.0.tar.gz master: http://tarballs.openstack.org/swift/swift-master.tar.gz commands = python -m unittest discover From 91b3fc26492ff05f0dc6dfd531237ec1317a9f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerard=20Gin=C3=A9?= Date: Thu, 28 Jan 2021 15:12:34 -0800 Subject: [PATCH 019/160] Remove reference to SMB & NFS in helper scripts (#575) --- .../proxyfs/files/default/usr/bin/disable_s3 | 2 +- .../proxyfs/files/default/usr/bin/enable_s3 | 2 +- .../files/default/usr/bin/start_and_mount_pfs | 111 +++++++ .../default/usr/bin/unmount_and_stop_pfs | 43 --- cookbooks/proxyfs/recipes/default.rb | 21 +- .../default/usr/bin/start_and_mount_pfs.erb | 298 ------------------ 6 files changed, 116 insertions(+), 361 deletions(-) create mode 100755 cookbooks/proxyfs/files/default/usr/bin/start_and_mount_pfs delete mode 100755 cookbooks/proxyfs/templates/default/usr/bin/start_and_mount_pfs.erb diff --git a/cookbooks/proxyfs/files/default/usr/bin/disable_s3 b/cookbooks/proxyfs/files/default/usr/bin/disable_s3 index 8f27621d7..1cf385cc7 100755 --- a/cookbooks/proxyfs/files/default/usr/bin/disable_s3 +++ b/cookbooks/proxyfs/files/default/usr/bin/disable_s3 @@ -32,4 +32,4 @@ PROXYSERVERCONF=/etc/swift/proxy-server.conf sed -i "/^pipeline/ s/${LIBRARY} tempauth/tempauth/" $PROXYSERVERCONF echo "${LIBRARY} was successfully disabled. Remember to restart Swift or just run:" -echo " start_and_mount_pfs keepmounts" +echo " start_and_mount_pfs" diff --git a/cookbooks/proxyfs/files/default/usr/bin/enable_s3 b/cookbooks/proxyfs/files/default/usr/bin/enable_s3 index e546499b3..a24c3bd03 100755 --- a/cookbooks/proxyfs/files/default/usr/bin/enable_s3 +++ b/cookbooks/proxyfs/files/default/usr/bin/enable_s3 @@ -36,4 +36,4 @@ sed -i '/^pipeline/ s/s3api tempauth/tempauth/' $PROXYSERVERCONF sed -i "/^pipeline/ s/tempauth/${LIBRARY} tempauth/" $PROXYSERVERCONF echo "${LIBRARY} was successfully enabled. Remember to restart Swift or just run:" -echo " start_and_mount_pfs keepmounts" +echo " start_and_mount_pfs" diff --git a/cookbooks/proxyfs/files/default/usr/bin/start_and_mount_pfs b/cookbooks/proxyfs/files/default/usr/bin/start_and_mount_pfs new file mode 100755 index 000000000..10a13b279 --- /dev/null +++ b/cookbooks/proxyfs/files/default/usr/bin/start_and_mount_pfs @@ -0,0 +1,111 @@ +#!/bin/bash + +# Copyright (c) 2015-2021, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 + +# A simple script to start the services and mount the sample mount point +# The PATH, etc should already be setup by systemctl environment + +function await_proxyfsd_startup { + /usr/bin/systemctl -q is-active proxyfsd + if [ $? -ne 0 ]; then + echo "ProxyFS failed to start. Exiting..." + exit 1 + fi + while true; do + curl http://127.0.0.1:15346/ 2>/dev/null >/dev/null + if [ $? -eq 0 ]; then + break + fi + echo "Waiting for ProxyFS to be started..." + sleep 1 + done +} + +function await_pfsagentd_startup { + /usr/bin/systemctl -q is-active pfsagentd + if [ $? -ne 0 ]; then + echo "PFSAgent failed to start. Exiting..." + exit 1 + fi + while true; do + curl http://127.0.0.1:9090/version 2>/dev/null >/dev/null + if [ $? -eq 0 ]; then + # Service is active and curl to the HTTP server succeeded. + # We're go to go. + break + fi + echo "Waiting for PFSAgent to be started..." + sleep 1 + done +} + +function await_swift_startup { + while true + do + curl http://127.0.0.1:8090/info 2>/dev/null >/dev/null + if [ $? -eq 0 ] + then + break + fi + echo "Waiting for Swift to be started..." + sleep 1 + done +} + +function format_volume_if_necessary { + sudo $GOPATH/bin/mkproxyfs -I $1 /etc/proxyfsd/saioproxyfsd0.conf SwiftClient.RetryLimit=1 + if [ $? -ne 0 ] + then + echo "Could not pre-format $1" + exit 1 + fi +} + +function containsElement () { + local e match="$1" + shift + for e; do [[ "$e" == "$match" ]] && return 0; done + return 1 +} + +# Making sure $GOPATH contains something: +source ~/.bashrc +if [ -z "$GOPATH" ]; then + GOPATH=/home/swift/code/ProxyFS +fi + +sudo mount -a + +echo "Shutting down services and mount points..." +/usr/bin/unmount_and_stop_pfs +echo + +echo "Bringing up services..." +if [ -f /usr/bin/systemctl ]; then + # Centos + MOUNT=/usr/bin/mount + sudo /usr/bin/systemctl start memcached + sudo /usr/bin/swift-init main start + await_swift_startup + format_volume_if_necessary CommonVolume + sudo /usr/bin/systemctl start proxyfsd + await_proxyfsd_startup + echo "ProxyFS successfully started" + echo "Starting PFSAgent..." + sudo /usr/bin/systemctl start pfsagentd + await_pfsagentd_startup +else + # Ubuntu (not tested!) + MOUNT=/bin/mount + sudo /usr/sbin/service memcached start + sudo /usr/bin/swift-init main start + await_swift_startup + format_volume_if_necessary CommonVolume + sudo /usr/sbin/service proxyfsd start + await_proxyfsd_startup + echo "ProxyFS successfully started" + # Here we should start pfsagentd (if 'all' or 'pfsa' are present in + # $MOUNT_OPTIONS), but we don't support Ubuntu +fi +echo diff --git a/cookbooks/proxyfs/files/default/usr/bin/unmount_and_stop_pfs b/cookbooks/proxyfs/files/default/usr/bin/unmount_and_stop_pfs index ba8491139..38599bfd0 100755 --- a/cookbooks/proxyfs/files/default/usr/bin/unmount_and_stop_pfs +++ b/cookbooks/proxyfs/files/default/usr/bin/unmount_and_stop_pfs @@ -32,46 +32,9 @@ function await_pfsagentd_shutdown { done } -MOUNT_POINT_NFS=127.0.0.1:/CommonMountPoint -SHARE_NFS=/mnt/nfs_proxyfs_mount/ - -MOUNT_POINT_SMB=//127.0.0.1/proxyfs -SHARE_SMB=/mnt/smb_proxyfs_mount/ - -if [ $# = 0 ]; then - SHOULD_UNMOUNT=1 -else - if [ $1 = "keepmounts" ]; then - SHOULD_UNMOUNT=0 - else - echo "Invalid argument: $1" - exit 1 - fi -fi - -if [ $SHOULD_UNMOUNT = 1 ]; then - mountpoint -q $SHARE_NFS - if [ $? -eq 0 ]; then - echo "Unmounting NFS mount point at '${SHARE_NFS}'..." - sudo umount $SHARE_NFS - fi - - mountpoint -q $SHARE_SMB - if [ $? -eq 0 ]; then - echo "Unmounting SMB mount point at '${SHARE_SMB}'..." - sudo umount $SHARE_SMB - fi -fi - if [ -f /usr/bin/systemctl ]; then # Centos sudo /usr/bin/systemctl stop pfsagentd - sudo /usr/bin/systemctl stop nfs-idmap - sudo /usr/bin/systemctl stop nfs-lock - sudo /usr/bin/systemctl stop nfs-server - sudo /usr/bin/systemctl stop rpcbind - sudo /usr/bin/systemctl stop smb - sudo /usr/bin/systemctl stop nmb # We need to make sure PFSAgent is stopped before we stop ProxyFS, but we # don't care if other services are stopped in the meantime. await_pfsagentd_shutdown @@ -82,12 +45,6 @@ if [ -f /usr/bin/systemctl ]; then else # Ubuntu (not tested!) # Here we should stop pfsagentd, but we don't support Ubuntu - sudo /usr/sbin/service nfs-idmap stop - sudo /usr/sbin/service nfs-lock stop - sudo /usr/sbin/service nfs-server stop - sudo /usr/sbin/service rpcbind stop - sudo /usr/sbin/service smbd stop - sudo /usr/sbin/service nmbd stop sudo /usr/sbin/service proxyfsd stop await_proxyfsd_shutdown sudo /usr/bin/swift-init main stop diff --git a/cookbooks/proxyfs/recipes/default.rb b/cookbooks/proxyfs/recipes/default.rb index 2cb653925..20173fa8c 100644 --- a/cookbooks/proxyfs/recipes/default.rb +++ b/cookbooks/proxyfs/recipes/default.rb @@ -162,6 +162,7 @@ command "install -m 0755 #{PROXYFS_SRC_DIR}/pfs-swift-load/pfs-swift-load-plot #{PROXYFS_BIN_DIR}/" end +# TODO: install aws cli v2 execute "Install awscli and awscli-plugin-endpoint" do command "pip install awscli awscli-plugin-endpoint" end @@ -214,14 +215,8 @@ group proxyfs_group end -template "/usr/bin/start_and_mount_pfs" do - mode '0755' - source "usr/bin/start_and_mount_pfs.erb" - variables({ - :swift_user => node['swift_user'], - :swift_uid => node['swift_uid'], - :swift_gid => node['swift_gid'] - }) +execute "Provision start_and_mount_pfs" do + command "install -m 0755 #{source_root}/src/github.com/swiftstack/ProxyFS/cookbooks/proxyfs/files/default/usr/bin/start_and_mount_pfs /usr/bin" end execute "Provision start_swift_only" do @@ -428,16 +423,6 @@ # # Create mount point and fstab entry # -execute "Create SMB mount point" do - command "mkdir /mnt/smb_proxyfs_mount" - not_if { ::Dir.exists?("/mnt/smb_proxyfs_mount") } -end - -execute "Create NFS mount point" do - command "mkdir /mnt/nfs_proxyfs_mount" - not_if { ::Dir.exists?("/mnt/nfs_proxyfs_mount") } -end - execute "Create PFSAgent mount point" do command "mkdir /mnt/pfsa_proxyfs_mount" not_if { ::Dir.exists?("/mnt/pfsa_proxyfs_mount") } diff --git a/cookbooks/proxyfs/templates/default/usr/bin/start_and_mount_pfs.erb b/cookbooks/proxyfs/templates/default/usr/bin/start_and_mount_pfs.erb deleted file mode 100755 index b62e86338..000000000 --- a/cookbooks/proxyfs/templates/default/usr/bin/start_and_mount_pfs.erb +++ /dev/null @@ -1,298 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2015-2021, NVIDIA CORPORATION. -# SPDX-License-Identifier: Apache-2.0 - -# A simple script to start the services and mount the sample mount point -# The PATH, etc should already be setup by systemctl environment - -function await_proxyfsd_startup { - /usr/bin/systemctl -q is-active proxyfsd - if [ $? -ne 0 ]; then - echo "ProxyFS failed to start. Exiting..." - exit 1 - fi - while true; do - curl http://127.0.0.1:15346/ 2>/dev/null >/dev/null - if [ $? -eq 0 ]; then - break - fi - echo "Waiting for ProxyFS to be started..." - sleep 1 - done -} - -function await_pfsagentd_startup { - /usr/bin/systemctl -q is-active pfsagentd - if [ $? -ne 0 ]; then - echo "PFSAgent failed to start. Exiting..." - exit 1 - fi - while true; do - curl http://127.0.0.1:9090/version 2>/dev/null >/dev/null - if [ $? -eq 0 ]; then - # Service is active and curl to the HTTP server succeeded. - # We're go to go. - break - fi - echo "Waiting for PFSAgent to be started..." - sleep 1 - done -} - -function await_swift_startup { - while true - do - curl http://127.0.0.1:8090/info 2>/dev/null >/dev/null - if [ $? -eq 0 ] - then - break - fi - echo "Waiting for Swift to be started..." - sleep 1 - done -} - -function format_volume_if_necessary { - sudo $GOPATH/bin/mkproxyfs -I $1 /etc/proxyfsd/saioproxyfsd0.conf SwiftClient.RetryLimit=1 - if [ $? -ne 0 ] - then - echo "Could not pre-format $1" - exit 1 - fi -} - -function containsElement () { - local e match="$1" - shift - for e; do [[ "$e" == "$match" ]] && return 0; done - return 1 -} - -help() { - echo "Usage: $0 [mount type]" - echo "Mount type options:" - echo " all: NFS v3 and SMB v3.0 (default option)" - echo " keepmounts: don't umount/mount any mountpoints" - echo " nfs: NFS v3" - echo " smb: SMB v3.0" - echo " smb1: SMB v1.0" - echo " smb2: SMB v2.1" - echo " smb3: SMB v3.0" - echo " pfsa: PFSAgent" -} - -MOUNT_OPTIONS=() -if [ $# -gt 0 ]; then - while [[ $# -gt 0 ]]; do - key="$1" - case $key in - -h|--help) - help - exit 0 - ;; - all|keepmounts|smb|smb1|smb2|smb3|nfs|pfsa) - if containsElement "$key" "${MOUNT_OPTIONS[@]}"; then - echo "Error: duplicated option '${key}'." - echo - help - exit 1 - fi - MOUNT_OPTIONS+=("$1") - shift - ;; - *) - echo "Invalid argument '$key'." - echo - help - exit 1 - esac - done - - # Now that we allow more than one mount option to be passed, we have to check - # for incompatible options. - if [ ${#MOUNT_OPTIONS[@]} -gt 1 ] && containsElement "all" "${MOUNT_OPTIONS[@]}"; then - echo "Error: no other options are allowed while using 'all'." - echo - help - exit 1 - fi - - if [ ${#MOUNT_OPTIONS[@]} -gt 1 ] && containsElement "keepmounts" "${MOUNT_OPTIONS[@]}"; then - echo "Error: no other options are allowed while using 'keepmounts'." - echo - help - exit 1 - fi - - # I know the next 4 'if' clauses are gross, but I don't have the patience to - # find out the proper way to do it in bash. - if [ ${#MOUNT_OPTIONS[@]} -gt 1 ] && containsElement "smb" "${MOUNT_OPTIONS[@]}"; then - if containsElement "smb1" "${MOUNT_OPTIONS[@]}" || containsElement "smb2" "${MOUNT_OPTIONS[@]}" || containsElement "smb3" "${MOUNT_OPTIONS[@]}"; then - echo "Error: only one SMB option can be specified at a time." - echo - help - exit 1 - fi - fi - - if [ ${#MOUNT_OPTIONS[@]} -gt 1 ] && containsElement "smb1" "${MOUNT_OPTIONS[@]}"; then - if containsElement "smb" "${MOUNT_OPTIONS[@]}" || containsElement "smb2" "${MOUNT_OPTIONS[@]}" || containsElement "smb3" "${MOUNT_OPTIONS[@]}"; then - echo "Error: only one SMB option can be specified at a time." - echo - help - exit 1 - fi - fi - - if [ ${#MOUNT_OPTIONS[@]} -gt 1 ] && containsElement "smb2" "${MOUNT_OPTIONS[@]}"; then - if containsElement "smb1" "${MOUNT_OPTIONS[@]}" || containsElement "smb" "${MOUNT_OPTIONS[@]}" || containsElement "smb3" "${MOUNT_OPTIONS[@]}"; then - echo "Error: only one SMB option can be specified at a time." - echo - help - exit 1 - fi - fi - - if [ ${#MOUNT_OPTIONS[@]} -gt 1 ] && containsElement "smb3" "${MOUNT_OPTIONS[@]}"; then - if containsElement "smb1" "${MOUNT_OPTIONS[@]}" || containsElement "smb2" "${MOUNT_OPTIONS[@]}" || containsElement "smb" "${MOUNT_OPTIONS[@]}"; then - echo "Error: only one SMB option can be specified at a time." - echo - help - exit 1 - fi - fi -else - MOUNT_OPTIONS+=("all") -fi - -if containsElement "all" "${MOUNT_OPTIONS[@]}"; then - NFS_VERS=3 - SMB_VERS=3.0 -else - if containsElement "nfs" "${MOUNT_OPTIONS[@]}"; then - NFS_VERS=3 - fi - - if containsElement "smb1" "${MOUNT_OPTIONS[@]}"; then - SMB_VERS=1.0 - elif containsElement "smb2" "${MOUNT_OPTIONS[@]}"; then - SMB_VERS=2.1 - elif containsElement "smb" "${MOUNT_OPTIONS[@]}" || containsElement "smb3" "${MOUNT_OPTIONS[@]}"; then - SMB_VERS=3.0 - fi -fi - -MOUNT_POINT_NFS=127.0.0.1:/CommonMountPoint -SHARE_NFS=/mnt/nfs_proxyfs_mount/ - -MOUNT_POINT_SMB=//127.0.0.1/proxyfs -SHARE_SMB=/mnt/smb_proxyfs_mount/ - -# Making sure $GOPATH contains something: -source ~/.bashrc -if [ -z "$GOPATH" ]; then - GOPATH=/home/swift/code/ProxyFS -fi - -UID_SMB=`id -u` -GID_SMB=`id -g` - -sudo mount -a - -# "keepmounts" means "keep everything as it was", but PFSAgent works differently, -# so just preserving the mount points is not enough. What we'll do is check if -# it's running before trying to stop it, and if it is, save it as a "MOUNT_OPTION" -if [ -f /usr/bin/systemctl ] && containsElement "keepmounts" "${MOUNT_OPTIONS[@]}"; then - /usr/bin/systemctl is-active --quiet pfsagentd && MOUNT_OPTIONS+=("pfsa") -fi - -if containsElement "keepmounts" "${MOUNT_OPTIONS[@]}"; then - echo "Shutting down services..." - /usr/bin/unmount_and_stop_pfs keepmounts -else - echo "Shutting down services and mount points..." - /usr/bin/unmount_and_stop_pfs -fi -echo - -echo "Bringing up services..." -if [ -f /usr/bin/systemctl ]; then - # Centos - MOUNT=/usr/bin/mount - sudo /usr/bin/systemctl start memcached - sudo /usr/bin/swift-init main start - await_swift_startup - format_volume_if_necessary CommonVolume - sudo /usr/bin/systemctl start proxyfsd - await_proxyfsd_startup - echo "ProxyFS successfully started" - sudo /usr/bin/systemctl start nmb - sudo /usr/bin/systemctl start smb - sudo /usr/bin/systemctl start rpcbind - sudo /usr/bin/systemctl start nfs-server - sudo /usr/bin/systemctl start nfs-lock - sudo /usr/bin/systemctl start nfs-idmap - if containsElement "all" "${MOUNT_OPTIONS[@]}" || containsElement "pfsa" "${MOUNT_OPTIONS[@]}"; then - echo "Starting PFSAgent..." - sudo /usr/bin/systemctl start pfsagentd - await_pfsagentd_startup - fi -else - # Ubuntu (not tested!) - MOUNT=/bin/mount - sudo /usr/sbin/service memcached start - sudo /usr/bin/swift-init main start - await_swift_startup - format_volume_if_necessary CommonVolume - sudo /usr/sbin/service proxyfsd start - await_proxyfsd_startup - echo "ProxyFS successfully started" - sudo /usr/sbin/service nmbd start - sudo /usr/sbin/service smbd start - sudo /usr/sbin/service rpcbind start - sudo /usr/sbin/service nfs-server start - sudo /usr/sbin/service nfs-lock start - sudo /usr/sbin/service nfs-idmap start - # Here we should start pfsagentd (if 'all' or 'pfsa' are present in - # $MOUNT_OPTIONS), but we don't support Ubuntu -fi -echo - -if containsElement "all" "${MOUNT_OPTIONS[@]}" || containsElement "nfs" "${MOUNT_OPTIONS[@]}"; then - mountpoint -q $SHARE_NFS - if [ $? -ne 0 ]; then - for i in $(seq 5); do - sleep 5 - sudo $MOUNT -t nfs -o vers=$NFS_VERS $MOUNT_POINT_NFS $SHARE_NFS && break - echo "Mount of $SHARE_NFS failed. Retrying..." - done - fi - - mountpoint -q $SHARE_NFS - if [ $? -ne 0 ]; then - echo "ERROR: Could not mount $SHARE_NFS." - exit 1 - else - echo "$SHARE_NFS successfully mounted" - fi -fi - -if containsElement "all" "${MOUNT_OPTIONS[@]}" || containsElement "smb" "${MOUNT_OPTIONS[@]}" || containsElement "smb1" "${MOUNT_OPTIONS[@]}" || containsElement "smb2" "${MOUNT_OPTIONS[@]}" || containsElement "smb3" "${MOUNT_OPTIONS[@]}"; then - mountpoint -q $SHARE_SMB - if [ $? -ne 0 ]; then - for i in $(seq 5); do - sleep 5 - sudo $MOUNT -t cifs -o user=<%= @swift_user %>,password=<%= @swift_user %>,domain=LOCALHOST,uid=$UID_SMB,gid=$GID_SMB,vers=$SMB_VERS,iocharset=utf8,actimeo=0 $MOUNT_POINT_SMB $SHARE_SMB && break - echo "Mount of $SHARE_SMB failed. Retrying..." - done - fi - - mountpoint -q $SHARE_SMB - if [ $? -ne 0 ]; then - echo "ERROR: Could not mount $SHARE_SMB." - exit 1 - else - echo "$SHARE_SMB successfully mounted" - fi -fi From 12c1724186e62e4b060535c150f9c4ae0ec3cd90 Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Fri, 29 Jan 2021 12:31:51 -0800 Subject: [PATCH 020/160] Forced cachedStat loading & missing unlock in DoRead()/DoWrite() --- pfsagentd/fission.go | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/pfsagentd/fission.go b/pfsagentd/fission.go index 466da600d..c98118c96 100644 --- a/pfsagentd/fission.go +++ b/pfsagentd/fission.go @@ -108,6 +108,34 @@ func unixTimeToNs(sec uint64, nsec uint32) (ns uint64) { return } +func (fileInode *fileInodeStruct) ensureCachedStatPopulatedWhileLocked() (err error) { + var ( + getStatReply *jrpcfs.StatStruct + getStatRequest *jrpcfs.GetStatRequest + ) + + if nil == fileInode.cachedStat { + getStatRequest = &jrpcfs.GetStatRequest{ + InodeHandle: jrpcfs.InodeHandle{ + MountID: globals.mountID, + InodeNumber: int64(fileInode.InodeNumber), + }, + } + + getStatReply = &jrpcfs.StatStruct{} + + err = globals.retryRPCClient.Send("RpcGetStat", getStatRequest, getStatReply) + if nil != err { + return + } + + fileInode.cachedStat = getStatReply + } + + err = nil + return +} + func (dummy *globalsStruct) DoLookup(inHeader *fission.InHeader, lookupIn *fission.LookupIn) (lookupOut *fission.LookupOut, errno syscall.Errno) { var ( aTimeNSec uint32 @@ -1238,11 +1266,19 @@ func (dummy *globalsStruct) DoRead(inHeader *fission.InHeader, readIn *fission.R } // defer fileInode.dereference() + err = fileInode.ensureCachedStatPopulatedWhileLocked() + if nil != err { + fileInode.unlock(true) + errno = convertErrToErrno(err, syscall.EIO) + return + } + // grantedLock = fileInode.getSharedLock() // defer grantedLock.release() err = fileInode.populateExtentMap(uint64(readIn.Offset), uint64(readIn.Size)) if nil != err { + fileInode.unlock(true) errno = convertErrToErrno(err, syscall.EIO) return } @@ -1277,6 +1313,7 @@ func (dummy *globalsStruct) DoRead(inHeader *fission.InHeader, readIn *fission.R logSegmentCacheElement = fetchLogSegmentCacheLine(readPlanStepAsMultiObjectExtentStruct.containerName, readPlanStepAsMultiObjectExtentStruct.objectName, curObjectOffset) if logSegmentCacheElementStateGetFailed == logSegmentCacheElement.state { + fileInode.unlock(true) errno = syscall.EIO return } @@ -1318,6 +1355,8 @@ func (dummy *globalsStruct) DoRead(inHeader *fission.InHeader, readIn *fission.R } } + fileInode.unlock(true) + _ = atomic.AddUint64(&globals.metrics.FUSE_DoRead_bytes, uint64(len(readOut.Data))) errno = 0 @@ -1328,6 +1367,7 @@ func (dummy *globalsStruct) DoWrite(inHeader *fission.InHeader, writeIn *fission var ( chunkedPutContext *chunkedPutContextStruct chunkedPutContextElement *list.Element + err error fhInodeNumber uint64 fileInode *fileInodeStruct ok bool @@ -1355,6 +1395,12 @@ func (dummy *globalsStruct) DoWrite(inHeader *fission.InHeader, writeIn *fission logFatalf("DoWrite(NodeID=%v,FH=%v) called for non-FileInode", inHeader.NodeID, writeIn.FH) } + err = fileInode.ensureCachedStatPopulatedWhileLocked() + if nil != err { + errno = convertErrToErrno(err, syscall.EIO) + return + } + // Grab quota to start a fresh chunkedPutContext before calling fileInode.getExclusiveLock() // since, in the pathologic case where only fileInode has any outstanding chunkedPutContext's, // they can only be complete()'d while holding fileInode.getExclusiveLock() and we would @@ -1578,6 +1624,7 @@ func (dummy *globalsStruct) DoFSync(inHeader *fission.InHeader, fSyncIn *fission globals.Unlock() + fileInode = lockInodeWithExclusiveLease(inode.InodeNumber(inHeader.NodeID)) // fileInode = referenceFileInode(inode.InodeNumber(inHeader.NodeID)) if nil == fileInode { logFatalf("DoFSync(NodeID=%v,FH=%v) called for non-FileInode", inHeader.NodeID, fSyncIn.FH) @@ -1586,6 +1633,7 @@ func (dummy *globalsStruct) DoFSync(inHeader *fission.InHeader, fSyncIn *fission fileInode.doFlushIfNecessary() // fileInode.dereference() + fileInode.unlock(false) errno = 0 return From b8a45311937ca28cf797b549910499f355811416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerard=20Gin=C3=A9?= Date: Fri, 29 Jan 2021 15:41:07 -0800 Subject: [PATCH 021/160] Stop installing smb nfs runway (#577) This means we can stop using "SwiftStack packages", so removing all the references to that from code as well. --- ci/ansible/chef_files/ci.attribs.json | 3 +- ci/ansible/chef_files/packages/debian.json | 18 -- ci/ansible/chef_files/packages/rhel.json | 17 -- ci/ansible/chef_files/packages/rhel_ss.json | 37 ---- ci/ansible/chef_files/runway.attribs.json | 1 - ci/ansible/chef_files/runway_ss.attribs.json | 35 ---- ci/ansible/chef_files/runway_ss.cfg | 3 - ci/ansible/chef_files/vagrant.attribs.json | 3 +- ci/ansible/install_proxyfs.sh | 9 +- .../usr/bin/reprovision_proxyfs.template | 2 +- ci/ansible/vars/runway_ss.yml | 6 - cookbooks/proxyfs/recipes/default.rb | 182 +----------------- 12 files changed, 9 insertions(+), 307 deletions(-) delete mode 100644 ci/ansible/chef_files/packages/rhel_ss.json delete mode 100644 ci/ansible/chef_files/runway_ss.attribs.json delete mode 100644 ci/ansible/chef_files/runway_ss.cfg delete mode 100644 ci/ansible/vars/runway_ss.yml diff --git a/ci/ansible/chef_files/ci.attribs.json b/ci/ansible/chef_files/ci.attribs.json index 9260af429..a86f6a0ec 100644 --- a/ci/ansible/chef_files/ci.attribs.json +++ b/ci/ansible/chef_files/ci.attribs.json @@ -29,6 +29,5 @@ "swift_bench_repo": "git://github.com/openstack/swift-bench.git", "swift_bench_repo_branch": "master", "extra_key": "", - "source_root": "/home/swiftstack/provisioning", - "use_swiftstack_packages": false + "source_root": "/home/swiftstack/provisioning" } diff --git a/ci/ansible/chef_files/packages/debian.json b/ci/ansible/chef_files/packages/debian.json index 8b0c59378..e6e50dae8 100644 --- a/ci/ansible/chef_files/packages/debian.json +++ b/ci/ansible/chef_files/packages/debian.json @@ -1,18 +1,4 @@ { - "samba_packages": [ - ["samba"], - ["smbclient"] - ], - "samba_deps": [ - ["gcc"], - ["python-dev"], - ["libgnutls-dev"], - ["libacl1-dev"], - ["libldap2-dev"], - ["pkg-config"], - ["cifs-utils"], - ["libpam0g-dev"] - ], "proxyfs_packages": [ ["libjson-c-dev"], ["fuse"] @@ -24,10 +10,6 @@ "ssh_packages": [ ["sshpass"] ], - "nfs_packages": [ - ["nfs-kernel-server"], - ["nfs-common"] - ], "gdb_packages": [ ["gdb"] ], diff --git a/ci/ansible/chef_files/packages/rhel.json b/ci/ansible/chef_files/packages/rhel.json index 988718339..5d6b8f8b1 100644 --- a/ci/ansible/chef_files/packages/rhel.json +++ b/ci/ansible/chef_files/packages/rhel.json @@ -1,18 +1,4 @@ { - "samba_packages": [ - ["samba"], - ["samba-client"] - ], - "samba_deps": [ - ["gcc"], - ["gcc-c++"], - ["python-devel"], - ["gnutls-devel"], - ["libacl-devel"], - ["openldap-devel"], - ["cifs-utils"], - ["pam-devel"] - ], "proxyfs_packages": [ ["json-c-devel"], ["fuse"] @@ -24,9 +10,6 @@ "ssh_packages": [ ["sshpass"] ], - "nfs_packages": [ - ["nfs-utils"] - ], "gdb_packages": [ ["gdb"], ["yum-utils"] diff --git a/ci/ansible/chef_files/packages/rhel_ss.json b/ci/ansible/chef_files/packages/rhel_ss.json deleted file mode 100644 index f0577b8de..000000000 --- a/ci/ansible/chef_files/packages/rhel_ss.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "samba_packages": [ - ["ss-samba", "4.6.2-3.el7"] - ], - "samba_deps": [ - ["gcc", "4.8.5-44.el7"], - ["gcc-c++", "4.8.5-44.el7"], - ["python-devel", "2.7.5-90.el7"], - ["gnutls-devel", "3.3.29-9.el7_6"], - ["libacl-devel", "2.2.51-15.el7"], - ["openldap-devel", "2.4.44-22.el7"], - ["cifs-utils", "6.2-10.el7"], - ["pam-devel", "1.1.8-23.el7"] - ], - "proxyfs_packages": [ - ["json-c-devel", "0.11-4.el7_0"], - ["fuse", "2.9.3-5.el7"] - ], - "wireshark_packages": [ - ["wireshark"], - ["libcap"] - ], - "ssh_packages": [ - ["sshpass"] - ], - "nfs_packages": [ - ["nfs-utils", "1.3.0-0.68.el7"] - ], - "gdb_packages": [ - ["gdb", "7.6.1-120.el7"], - ["yum-utils"] - ], - "utils_packages": [ - ["atop"], - ["vim-common"] - ] -} diff --git a/ci/ansible/chef_files/runway.attribs.json b/ci/ansible/chef_files/runway.attribs.json index d18d0490b..a8b584d01 100644 --- a/ci/ansible/chef_files/runway.attribs.json +++ b/ci/ansible/chef_files/runway.attribs.json @@ -30,6 +30,5 @@ "swift_bench_repo_branch": "master", "extra_key": "", "source_root": "/home/swift/code/ProxyFS", - "use_swiftstack_packages": false, "package_spec_path": "/home/swift/code/ProxyFS/src/github.com/swiftstack/ProxyFS/ci/ansible/chef_files/packages" } diff --git a/ci/ansible/chef_files/runway_ss.attribs.json b/ci/ansible/chef_files/runway_ss.attribs.json deleted file mode 100644 index cdf8c6b65..000000000 --- a/ci/ansible/chef_files/runway_ss.attribs.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "run_list": [ "recipe[pfs_middleware]", "recipe[meta_middleware]", "recipe[proxyfs_swift]", "recipe[proxyfs]" ], - "full_reprovision": "false", - "loopback_gb": 4, - "extra_packages": [], - "storage_policies": ["default"], - "ec_policy": "", - "servers_per_port": 0, - "object_sync_method": "rsync", - "post_as_copy": "true", - "part_power": 10, - "replicas": 3, - "ec_replicas": 6, - "regions": 1, - "zones": 4, - "nodes": 4, - "disks": 4, - "ec_disks": 8, - "swift_user": "swift", - "swift_group": "swift", - "swift_uid": 1000, - "swift_gid": 1000, - "proxyfs_user": "swift", - "proxyfs_group": "swift", - "swift_repo": "git://github.com/openstack/swift.git", - "swift_repo_branch": "master", - "swiftclient_repo": "git://github.com/openstack/python-swiftclient.git", - "swiftclient_repo_branch": "master", - "swift_bench_repo": "git://github.com/openstack/swift-bench.git", - "swift_bench_repo_branch": "master", - "extra_key": "", - "source_root": "/home/swift/code/ProxyFS", - "use_swiftstack_packages": true, - "package_spec_path": "/home/swift/code/ProxyFS/src/github.com/swiftstack/ProxyFS/ci/ansible/chef_files/packages" -} diff --git a/ci/ansible/chef_files/runway_ss.cfg b/ci/ansible/chef_files/runway_ss.cfg deleted file mode 100644 index f9aee8f6d..000000000 --- a/ci/ansible/chef_files/runway_ss.cfg +++ /dev/null @@ -1,3 +0,0 @@ -file_cache_path "/home/swift/chef" -cookbook_path "/home/swift/code/ProxyFS/src/github.com/swiftstack/ProxyFS/cookbooks" -json_attribs "/home/swift/code/ProxyFS/src/github.com/swiftstack/ProxyFS/ci/ansible/chef_files/runway_ss.attribs.json" diff --git a/ci/ansible/chef_files/vagrant.attribs.json b/ci/ansible/chef_files/vagrant.attribs.json index 4b17de57d..b8257f798 100644 --- a/ci/ansible/chef_files/vagrant.attribs.json +++ b/ci/ansible/chef_files/vagrant.attribs.json @@ -29,6 +29,5 @@ "swift_bench_repo": "git://github.com/openstack/swift-bench.git", "swift_bench_repo_branch": "master", "extra_key": "", - "source_root": "/vagrant", - "use_swiftstack_packages": false + "source_root": "/vagrant" } diff --git a/ci/ansible/install_proxyfs.sh b/ci/ansible/install_proxyfs.sh index 625d78d87..2cb2954d2 100755 --- a/ci/ansible/install_proxyfs.sh +++ b/ci/ansible/install_proxyfs.sh @@ -6,23 +6,18 @@ set -e ENV_NAME=$1 -SS_PACKAGES=$2 -GOLANG_VERSION=$3 +GOLANG_VERSION=$2 if [ -z "$ENV_NAME" ]; then echo "usage: $0 " exit 1 fi -if [ -n "$SS_PACKAGES" ] && [ "$ENV_NAME" == "runway" ] && [ "$SS_PACKAGES" == "swiftstack" ]; then - ENV_NAME="runway_ss" -fi - if [ -z "$GOLANG_VERSION" ]; then GOLANG_VERSION="current" fi SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -ansible-playbook -i "localhost," -c local -e env=$ENV_NAME -e env_arg="$1" -e ss_packages_arg="$2" -e golang_version="$GOLANG_VERSION" "$SCRIPT_DIR"/tasks/main.yml +ansible-playbook -i "localhost," -c local -e env=$ENV_NAME -e env_arg="$1" -e golang_version="$GOLANG_VERSION" "$SCRIPT_DIR"/tasks/main.yml chef-solo -c "$SCRIPT_DIR"/chef_files/$ENV_NAME.cfg diff --git a/ci/ansible/tasks/templates/usr/bin/reprovision_proxyfs.template b/ci/ansible/tasks/templates/usr/bin/reprovision_proxyfs.template index 0cf6d1ecf..07f6a375d 100644 --- a/ci/ansible/tasks/templates/usr/bin/reprovision_proxyfs.template +++ b/ci/ansible/tasks/templates/usr/bin/reprovision_proxyfs.template @@ -3,5 +3,5 @@ set -e /usr/bin/unmount_and_stop_pfs cd $GOPATH/src/github.com/swiftstack/ProxyFS -ci/ansible/install_proxyfs.sh {{ env_arg }} {{ ss_packages_arg }} {{ active_golang_version }} +ci/ansible/install_proxyfs.sh {{ env_arg }} {{ active_golang_version }} /usr/bin/start_and_mount_pfs "$@" diff --git a/ci/ansible/vars/runway_ss.yml b/ci/ansible/vars/runway_ss.yml deleted file mode 100644 index d094123b9..000000000 --- a/ci/ansible/vars/runway_ss.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -proxyfs_user: "swift" -proxyfs_group: "swift" -source_root: "/home/{{ proxyfs_user }}/code/ProxyFS" -REPO_CLONE_PARENT_DIR: "{{ source_root }}/src/github.com/swiftstack" -PROXYFS_SRC_DIR: "{{ REPO_CLONE_PARENT_DIR }}/ProxyFS" diff --git a/cookbooks/proxyfs/recipes/default.rb b/cookbooks/proxyfs/recipes/default.rb index 20173fa8c..e09a75be5 100644 --- a/cookbooks/proxyfs/recipes/default.rb +++ b/cookbooks/proxyfs/recipes/default.rb @@ -4,7 +4,6 @@ proxyfs_user = node['proxyfs_user'] proxyfs_group = node['proxyfs_group'] is_dev = node['is_dev_environment'] -ss_packages = node['use_swiftstack_packages'] package_spec_path = node['package_spec_path'] HOME_DIR = "/home/#{proxyfs_user}" @@ -16,30 +15,6 @@ REPO_CLONE_PARENT_DIR = "#{source_root}/src/github.com/swiftstack" PROXYFS_BIN_DIR = "#{source_root}/bin" PROXYFS_SRC_DIR = "#{REPO_CLONE_PARENT_DIR}/ProxyFS" -VFS_SRC_DIR = "#{PROXYFS_SRC_DIR}/vfs" -JRPCCLIENT_SRC_DIR = "#{PROXYFS_SRC_DIR}/jrpcclient" -# We're doing this to only need to change SAMBA_PARENT_DIR in case we decide to -# change the location of samba again in the future. -SAMBA_PARENT_DIR = "#{VFS_SRC_DIR}" -SAMBA_SRC_DIR = "#{SAMBA_PARENT_DIR}/samba" - -if node[:platform_family].include?("rhel") and ss_packages - cookbook_file "/etc/yum.repos.d/swiftstack-controller.repo" do - source "etc/yum.repos.d/swiftstack-controller.repo" - owner "root" - group "root" - end - - cookbook_file "/etc/pki/rpm-gpg/RPM-GPG-KEY-swiftstack-controller" do - source "etc/pki/rpm-gpg/RPM-GPG-KEY-swiftstack-controller" - owner "root" - group "root" - end - - execute "yum makecache" do - command "yum makecache" - end -end ruby_block "update_profile_and_bashrc" do block do @@ -73,14 +48,9 @@ file = Chef::Util::FileEdit.new(DOT_BASHRC) file.insert_line_if_no_match(/export GOPATH/, "export GOPATH=#{source_root}") - if ss_packages - file.insert_line_if_no_match(%r{usr/local/go/bin}, "export PATH=$GOPATH/bin:$PATH:/usr/local/go/bin:/opt/ss/bin:/opt/ss/sbin") - else - file.insert_line_if_no_match(%r{usr/local/go/bin}, "export PATH=$GOPATH/bin:$PATH:/usr/local/go/bin") - end + file.insert_line_if_no_match(%r{usr/local/go/bin}, "export PATH=$GOPATH/bin:$PATH:/usr/local/go/bin") file.insert_line_if_no_match(/cdpfs/, "alias cdpfs='cd $GOPATH/src/github.com/swiftstack/ProxyFS'") file.insert_line_if_no_match(/cdfun/, "alias cdfun='cd /home/swift/code/functional-tests'") - file.insert_line_if_no_match(/cdsamba/, "alias cdsamba='cd #{SAMBA_SRC_DIR}'") file.insert_line_if_no_match(/ls -lha/, "alias la='ls -lha'") file.insert_line_if_no_match(/ls -liha/, "alias li='ls -liha'") file.insert_line_if_no_match(/statmnt/, "alias statmnt='stat /mnt/*'") @@ -108,14 +78,9 @@ file = Chef::Util::FileEdit.new(ROOT_DOT_BASHRC) file.insert_line_if_no_match(/export GOPATH/, "export GOPATH=#{source_root}") - if ss_packages - file.insert_line_if_no_match(%r{usr/local/go/bin}, "export PATH=$GOPATH/bin:$PATH:/usr/local/go/bin:/opt/ss/bin:/opt/ss/sbin") - else - file.insert_line_if_no_match(%r{usr/local/go/bin}, "export PATH=$GOPATH/bin:$PATH:/usr/local/go/bin") - end + file.insert_line_if_no_match(%r{usr/local/go/bin}, "export PATH=$GOPATH/bin:$PATH:/usr/local/go/bin") file.insert_line_if_no_match(/cdpfs/, "alias cdpfs='cd $GOPATH/src/github.com/swiftstack/ProxyFS'") file.insert_line_if_no_match(/cdfun/, "alias cdfun='cd /home/swift/code/functional-tests'") - file.insert_line_if_no_match(/cdsamba/, "alias cdsamba='cd #{SAMBA_SRC_DIR}'") file.insert_line_if_no_match(/ls -lha/, "alias la='ls -lha'") file.insert_line_if_no_match(/ls -liha/, "alias li='ls -liha'") file.insert_line_if_no_match(/statmnt/, "alias statmnt='stat /mnt/*'") @@ -270,20 +235,6 @@ only_if { ::File.directory?("/usr/lib/systemd/system/") } end -if node[:platform_family].include?("rhel") and ss_packages - cookbook_file "/usr/lib/systemd/system/smb.service" do - source "usr/lib/systemd/system/smb.service" - # notifies :restart, 'service[smb]' - only_if { ::File.directory?("/usr/lib/systemd/system/") } - end - - cookbook_file "/usr/lib/systemd/system/nmb.service" do - source "usr/lib/systemd/system/nmb.service" - # notifies :restart, 'service[nmb]' - only_if { ::File.directory?("/usr/lib/systemd/system/") } - end -end - cookbook_file "/etc/init/proxyfsd.conf" do source "etc/init/proxyfsd.upstart" # notifies :restart, 'service[proxyfsd]' @@ -295,17 +246,13 @@ # Dependency lists by OS # if node[:platform_family].include?("rhel") - if ss_packages - package_spec_file_path = File.read(package_spec_path + '/rhel_ss.json') - else - package_spec_file_path = File.read(package_spec_path + '/rhel.json') - end + package_spec_file_path = File.read(package_spec_path + '/rhel.json') else # assume debian package_spec_file_path = File.read(package_spec_path + '/debian.json') end package_spec = JSON.parse(package_spec_file_path) -packages = package_spec['samba_packages'] + package_spec['samba_deps'] + package_spec['proxyfs_packages'] + package_spec['nfs_packages'] + package_spec['gdb_packages'] + package_spec['utils_packages'] +packages = package_spec['proxyfs_packages'] + package_spec['gdb_packages'] + package_spec['utils_packages'] packages += package_spec['wireshark_packages'] if is_dev packages += package_spec['ssh_packages'] if is_dev @@ -339,87 +286,6 @@ end end -# -# Always remake the samba symbolic link since the user may be switching between -# Centos and Ubuntu -# -execute "Remove samba symbolic link" do - command "rm -f samba" - cwd SAMBA_PARENT_DIR -end - - -# -# Check out and build samba -# -# For now we're hard-coding the OS. It should be parametrized. -OS_DISTRO="centos" -OS_DISTRO_VERSION="7.5" - -SAMBA_VERSION = ss_packages ? "4.6.2" : "" - -bash 'Check out samba + build headers if needed' do - code <<-EOH - if [ "#{SAMBA_VERSION}" = "" ]; then - SAMBA_VERSION="`smbstatus -V | cut -d' ' -f2 | tr -d '\\n'`" - else - SAMBA_VERSION="#{SAMBA_VERSION}" - fi - SAMBA_DIR="build-samba-`echo ${SAMBA_VERSION} | sed -e 's:\\.:-:g'`-#{OS_DISTRO}-#{OS_DISTRO_VERSION.gsub(".", "-")}" - - if [ -d "#{SAMBA_PARENT_DIR}/${SAMBA_DIR}" ]; then - ln -s ${SAMBA_DIR} #{SAMBA_SRC_DIR} - else - # Check out samba - git clone -b samba-${SAMBA_VERSION} --single-branch --depth 1 https://github.com/samba-team/samba.git ${SAMBA_DIR} - - ln -s ${SAMBA_DIR} #{SAMBA_SRC_DIR} - - cd #{SAMBA_SRC_DIR} - - # Configure samba src - # lockfile dropped by `waf configure` - if [ ! -f "#{SAMBA_SRC_DIR}/.lock-wscript" ]; then - ./configure - fi - - # Build samba headers - if [ ! -f "#{SAMBA_SRC_DIR}/bin/default/librpc/gen_ndr/server_id.h" ]; then - make GEN_NDR_TABLES - fi - fi - EOH - cwd SAMBA_PARENT_DIR -end - -# -# Configure Samba -# - -if ss_packages - smb_conf = "/opt/ss/etc/samba/smb.conf" -else - smb_conf = "/etc/samba/smb.conf" -end - -execute "Setup #{smb_conf}" do - command "cat sample_entry_smb_conf.txt > #{smb_conf}" - cwd "#{VFS_SRC_DIR}" -end - -ruby_block "update_smb_conf" do - block do - file = Chef::Util::FileEdit.new(smb_conf) - file.search_file_replace(/valid users = CHANGEME/, "valid users = #{node['swift_user']}") - file.write_file - end -end - -smbpasswd_path = ss_packages ? "/opt/ss/bin/smbpasswd" : "/bin/smbpasswd" -execute "Setup Samba password" do - command "printf \"#{node['swift_user']}\n#{node['swift_user']}\n\" | #{smbpasswd_path} -a -s #{node['swift_user']}" -end - # # Create mount point and fstab entry # @@ -491,46 +357,6 @@ group proxyfs_group end -if ss_packages - # Creating link to jrpcclient's libs into the new /opt/ss path - link '/opt/ss/lib64/libproxyfs.so.1.0.0' do - to "#{JRPCCLIENT_SRC_DIR}/libproxyfs.so.1.0.0" - link_type :symbolic - owner "root" - group "root" - end - - link '/opt/ss/lib64/libproxyfs.so.1' do - to "#{JRPCCLIENT_SRC_DIR}/libproxyfs.so.1.0.0" - link_type :symbolic - owner "root" - group "root" - end - - link '/opt/ss/lib64/libproxyfs.so' do - to "#{JRPCCLIENT_SRC_DIR}/libproxyfs.so.1.0.0" - link_type :symbolic - owner "root" - group "root" - end - - # Creating link to vfs' libs into the new /opt/ss path - directory '/opt/ss/lib64/samba/vfs' do - owner 'root' - group 'root' - mode '0755' - action :create - end - - link '/opt/ss/lib64/samba/vfs/proxyfs.so' do - to "#{VFS_SRC_DIR}/proxyfs.so" - link_type :symbolic - owner "root" - group "root" - mode '0755' - end -end - cookbook_file "#{HOME_DIR}/.gdbinit" do source "home/unprivileged_user/.gdbinit" owner "#{proxyfs_user}" From 1c3f56fee3ee430f6bf13bd9420ff3567d56d9d4 Mon Sep 17 00:00:00 2001 From: bschatz-swift Date: Mon, 1 Feb 2021 11:20:18 -0800 Subject: [PATCH 022/160] Add EtcdCertPath to conf file (#578) * Add EtcdCertDir to conf file --- CONFIGURING.md | 1 + .../sample-proxyfs-configuration/proxyfs.conf | 1 + etcdclient/api.go | 22 +++++++++---------- headhunter/config.go | 11 +++++++--- mkproxyfs/api.go | 11 +++++++--- pfs-fsck/main.go | 11 +++++++--- proxyfsd/default.conf | 1 + proxyfsd/file_server.conf | 1 + proxyfsd/file_server_mac_3_peers.conf | 1 + saio/container/proxyfs.conf | 1 + 10 files changed, 41 insertions(+), 20 deletions(-) diff --git a/CONFIGURING.md b/CONFIGURING.md index 740af9f06..e6c29853c 100644 --- a/CONFIGURING.md +++ b/CONFIGURING.md @@ -126,6 +126,7 @@ For each of the keys supported, the following table will list whether or not its | | EtcdEnabled | No | false | Yes but don't re-enable | No | | | EtcdEndpoints | If enabled | | Yes | No | | | EtcdAutoSyncInterval | If enabled | | Yes | No | +| | EtcdCertDir | If enabled | /etc/ssl/etcd/ssl/ | Yes | No | | | EtcdDialTimeout | If enabled | | Yes | No | | | EtcdOpTimeout | If enabled | | Yes | No | | | MetadataRecycleBin | No | false | Yes | No | diff --git a/confgen/sample-proxyfs-configuration/proxyfs.conf b/confgen/sample-proxyfs-configuration/proxyfs.conf index 3d7651b20..faa4219a3 100644 --- a/confgen/sample-proxyfs-configuration/proxyfs.conf +++ b/confgen/sample-proxyfs-configuration/proxyfs.conf @@ -126,6 +126,7 @@ HAMode: on EtcdEnabled: true EtcdAutoSyncInterval: 60000ms +EtcdCertDir: /etc/ssl/etcd/ssl/ EtcdDialTimeout: 10000ms EtcdOpTimeout: 20000ms diff --git a/etcdclient/api.go b/etcdclient/api.go index 528c8efb2..21b599a7c 100644 --- a/etcdclient/api.go +++ b/etcdclient/api.go @@ -13,8 +13,7 @@ import ( ) const ( - certPath = "/etc/ssl/etcd/ssl/" - trustedCAFile = certPath + "ca.pem" + trustedCAFile = "/ca.pem" ) // New initializes etcd config structures and returns an etcd client @@ -33,27 +32,28 @@ func New(tlsInfo *transport.TLSInfo, endPoints []string, autoSyncInterval time.D return } -// GetCertFile returns the name of the cert file for the local node -func GetCertFile() string { +// GetCertFilePath returns the name of the cert file for the local node +func GetCertFilePath(certDir string) string { h, _ := os.Hostname() - return certPath + "node-" + h + ".pem" + return certDir + "/node-" + h + ".pem" } -// GetKeyFile returns the name of the key file for the local node -func GetKeyFile() string { +// GetKeyFilePath returns the name of the key file for the local node +func GetKeyFilePath(certDir string) string { h, _ := os.Hostname() - return certPath + "node-" + h + "-key.pem" + return certDir + "/node-" + h + "-key.pem" } // GetCA returns the name of the certificate authority for the local node -func GetCA() string { +func GetCA(certDir string) string { var ( caFile string ) - _, statErr := os.Stat(trustedCAFile) + trustedCAFilePath := certDir + trustedCAFile + _, statErr := os.Stat(trustedCAFilePath) if os.IsExist(statErr) { - caFile = trustedCAFile + caFile = trustedCAFilePath } return caFile diff --git a/headhunter/config.go b/headhunter/config.go index 63c86c0be..e8c2c1794 100644 --- a/headhunter/config.go +++ b/headhunter/config.go @@ -200,6 +200,7 @@ type globalsStruct struct { etcdEnabled bool etcdEndpoints []string etcdAutoSyncInterval time.Duration + etcdCertDir string etcdDialTimeout time.Duration etcdOpTimeout time.Duration @@ -460,6 +461,10 @@ func (dummy *globalsStruct) Up(confMap conf.ConfMap) (err error) { if nil != err { return } + globals.etcdCertDir, err = confMap.FetchOptionValueString("FSGlobals", "EtcdCertDir") + if nil != err { + return + } globals.etcdDialTimeout, err = confMap.FetchOptionValueDuration("FSGlobals", "EtcdDialTimeout") if nil != err { return @@ -472,9 +477,9 @@ func (dummy *globalsStruct) Up(confMap conf.ConfMap) (err error) { // Initialize etcd Client & KV objects tlsInfo := transport.TLSInfo{ - CertFile: etcdclient.GetCertFile(), - KeyFile: etcdclient.GetKeyFile(), - TrustedCAFile: etcdclient.GetCA(), + CertFile: etcdclient.GetCertFilePath(globals.etcdCertDir), + KeyFile: etcdclient.GetKeyFilePath(globals.etcdCertDir), + TrustedCAFile: etcdclient.GetCA(globals.etcdCertDir), } globals.etcdClient, err = etcdclient.New(&tlsInfo, globals.etcdEndpoints, diff --git a/mkproxyfs/api.go b/mkproxyfs/api.go index 68842bacd..0c6901d1d 100644 --- a/mkproxyfs/api.go +++ b/mkproxyfs/api.go @@ -45,6 +45,7 @@ func Format(mode Mode, volumeNameToFormat string, confFile string, confStrings [ etcdClient *etcd.Client etcdDialTimeout time.Duration etcdEnabled bool + etcdCertDir string etcdEndpoints []string etcdKV etcd.KV etcdOpTimeout time.Duration @@ -111,6 +112,10 @@ func Format(mode Mode, volumeNameToFormat string, confFile string, confStrings [ } if etcdEnabled { + etcdCertDir, err = confMap.FetchOptionValueString("FSGlobals", "EtcdCertDir") + if nil != err { + return + } etcdEndpoints, err = confMap.FetchOptionValueStringSlice("FSGlobals", "EtcdEndpoints") if nil != err { return @@ -134,9 +139,9 @@ func Format(mode Mode, volumeNameToFormat string, confFile string, confStrings [ } tlsInfo := transport.TLSInfo{ - CertFile: etcdclient.GetCertFile(), - KeyFile: etcdclient.GetKeyFile(), - TrustedCAFile: etcdclient.GetCA(), + CertFile: etcdclient.GetCertFilePath(etcdCertDir), + KeyFile: etcdclient.GetKeyFilePath(etcdCertDir), + TrustedCAFile: etcdclient.GetCA(etcdCertDir), } // Initialize etcd Client & KV objects diff --git a/pfs-fsck/main.go b/pfs-fsck/main.go index d2b6be1b3..8945383da 100644 --- a/pfs-fsck/main.go +++ b/pfs-fsck/main.go @@ -51,6 +51,7 @@ type globalsStruct struct { etcdClient *etcd.Client etcdDialTimeout time.Duration etcdEnabled bool + etcdCertDir string etcdEndpoints []string etcdKV etcd.KV etcdOpTimeout time.Duration @@ -365,6 +366,10 @@ func setup() { if nil != err { log.Fatal(err) } + globals.etcdCertDir, err = confMap.FetchOptionValueString("FSGlobals", "EtcdCertDir") + if nil != err { + return + } globals.etcdDialTimeout, err = confMap.FetchOptionValueDuration("FSGlobals", "EtcdDialTimeout") if nil != err { log.Fatal(err) @@ -379,9 +384,9 @@ func setup() { } tlsInfo := transport.TLSInfo{ - CertFile: etcdclient.GetCertFile(), - KeyFile: etcdclient.GetKeyFile(), - TrustedCAFile: etcdclient.GetCA(), + CertFile: etcdclient.GetCertFilePath(globals.etcdCertDir), + KeyFile: etcdclient.GetKeyFilePath(globals.etcdCertDir), + TrustedCAFile: etcdclient.GetCA(globals.etcdCertDir), } globals.etcdClient, err = etcdclient.New(&tlsInfo, globals.etcdEndpoints, diff --git a/proxyfsd/default.conf b/proxyfsd/default.conf index d5437dc50..5e750e60e 100644 --- a/proxyfsd/default.conf +++ b/proxyfsd/default.conf @@ -200,6 +200,7 @@ FileExtentMapEvictHighLimit: 10010 EtcdEnabled: false EtcdEndpoints: 127.0.0.1:2379 EtcdAutoSyncInterval: 1m +EtcdCertDir: /etc/ssl/etcd/ssl/ EtcdDialTimeout: 10s EtcdOpTimeout: 20s MetadataRecycleBin: false diff --git a/proxyfsd/file_server.conf b/proxyfsd/file_server.conf index 79b7b38b2..3db18e868 100644 --- a/proxyfsd/file_server.conf +++ b/proxyfsd/file_server.conf @@ -135,6 +135,7 @@ FileExtentMapEvictHighLimit: 10010 EtcdEnabled: false EtcdEndpoints: 127.0.0.1:2379 EtcdAutoSyncInterval: 1m +EtcdCertDir: /etc/ssl/etcd/ssl/ EtcdDialTimeout: 10s EtcdOpTimeout: 20s MetadataRecycleBin: false diff --git a/proxyfsd/file_server_mac_3_peers.conf b/proxyfsd/file_server_mac_3_peers.conf index 652f59651..c64ca229b 100644 --- a/proxyfsd/file_server_mac_3_peers.conf +++ b/proxyfsd/file_server_mac_3_peers.conf @@ -143,6 +143,7 @@ FileExtentMapEvictHighLimit: 10010 EtcdEnabled: false EtcdEndpoints: 127.0.0.1:2379 EtcdAutoSyncInterval: 1m +EtcdCertDir: /etc/ssl/etcd/ssl/ EtcdDialTimeout: 10s EtcdOpTimeout: 20s MetadataRecycleBin: false diff --git a/saio/container/proxyfs.conf b/saio/container/proxyfs.conf index 6ce935bf5..d87ea9e5c 100644 --- a/saio/container/proxyfs.conf +++ b/saio/container/proxyfs.conf @@ -172,6 +172,7 @@ FileExtentMapEvictHighLimit: 10010 EtcdEnabled: false EtcdEndpoints: 127.0.0.1:2379 EtcdAutoSyncInterval: 1m +EtcdCertDir: /etc/ssl/etcd/ssl/ EtcdDialTimeout: 10s EtcdOpTimeout: 20s MetadataRecycleBin: false From b5bdd730d68810d50131610bad2ae49f33f52cac Mon Sep 17 00:00:00 2001 From: Darrell Bishop Date: Wed, 3 Feb 2021 09:41:28 -0800 Subject: [PATCH 023/160] Adding Contributer License Agreement v1.0.1 --- CLA | 151 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 CLA diff --git a/CLA b/CLA new file mode 100644 index 000000000..102ee1de7 --- /dev/null +++ b/CLA @@ -0,0 +1,151 @@ +Contribution License Agreement + +This Contribution License Agreement (“Agreement”) is agreed to by the party +signing below (“You”), and conveys certain license rights to NVIDIA Corporation +and its affiliates (“NVIDIA”) for Your contributions to NVIDIA open source +projects. This Agreement is effective as of the latest signature date below. + +1. Definitions. + +“Code” means the computer software code, whether in human-readable or +machine-executable form, that is delivered by You to NVIDIA under this +Agreement. + +“Project” means any of the projects owned or managed by NVIDIA in which +software is offered under a license approved by the Open Source Initiative +(OSI) (www.opensource.org) and documentation offered under an OSI or a +Creative Commons license (https://creativecommons.org/licenses). + +“Submit” is the act of uploading, submitting, transmitting, or distributing +code or other content to any Project, including but not limited to +communication on electronic mailing lists, source code control systems, +and issue tracking systems that are managed by, or on behalf of, the +Project for the purpose of discussing and improving that Project, but +excluding communication that is conspicuously marked or otherwise +designated in writing by You as “Not a Submission.” + +“Submission” means the Code and any other copyrightable material Submitted +by You, including any associated comments and documentation. + +2. Your Submission. You must agree to the terms of this Agreement before +making a Submission to any Project. This Agreement covers any and all +Submissions that You, now or in the future (except as described in Section +4 below), Submit to any Project. + +3. Originality of Work. You represent that each of Your Submissions is +entirely Your original work. Should You wish to Submit materials that are +not Your original work, You may Submit them separately to the Project if +You (a) retain all copyright and license information that was in the +materials as You received them, (b) in the description accompanying Your +Submission, include the phrase “Submission containing materials of a +third party:” followed by the names of the third party and any licenses +or other restrictions of which You are aware, and (c) follow any other +instructions in the Project’s written guidelines concerning Submissions. + +4. Your Employer. References to “employer” in this Agreement include Your +employer or anyone else for whom You are acting in making Your Submission, +e.g. as a contractor, vendor, or agent. If Your Submission is made in the +course of Your work for an employer or Your employer has intellectual +property rights in Your Submission by contract or applicable law, You must +secure permission from Your employer to make the Submission before signing +this Agreement. In that case, the term “You” in this Agreement will refer +to You and the employer collectively. If You change employers in the +future and desire to Submit additional Submissions for the new employer, +then You agree to sign a new Agreement and secure permission from the +new employer before Submitting those Submissions. + + +5. Licenses. + +a. Copyright License. You grant NVIDIA, and those who receive the Submission +directly or indirectly from NVIDIA, a perpetual, worldwide, non-exclusive, +royalty-free, irrevocable license in the Submission to reproduce, prepare +derivative works of, publicly display, publicly perform, and distribute the +Submission and such derivative works, and to sublicense any or all of the +foregoing rights to third parties. + +b. Patent License. You grant NVIDIA, and those who receive the Submission +directly or indirectly from NVIDIA, a perpetual, worldwide, non-exclusive, +royalty-free, irrevocable license under Your patent claims that are +necessarily infringed by the Submission or the combination of the Submission +with the Project to which it was Submitted to make, have made, use, offer to +sell, sell and import or otherwise dispose of the Submission alone or with +the Project. + +c. Other Rights Reserved. Each party reserves all rights not expressly +granted in this Agreement. No additional licenses or rights whatsoever +(including, without limitation, any implied licenses) are granted by +implication, exhaustion, estoppel or otherwise. + +6. Representations and Warranties. You represent that You are legally +entitled to grant the above licenses. You represent that each of Your +Submissions is entirely Your original work (except as You may have +disclosed under Section 3). You represent that You have secured permission +from Your employer to make the Submission in cases where Your Submission +is made in the course of Your work for Your employer or Your employer has +intellectual property rights in Your Submission by contract or applicable +law. If You are signing this Agreement on behalf of Your employer, You +represent and warrant that You have the necessary authority to bind the +listed employer to the obligations contained in this Agreement. You are +not expected to provide support for Your Submission, unless You choose to +do so. UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, AND +EXCEPT FOR THE WARRANTIES EXPRESSLY STATED IN SECTIONS 3, 4, AND 6, THE +SUBMISSION PROVIDED UNDER THIS AGREEMENT IS PROVIDED WITHOUT WARRANTY OF +ANY KIND, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY OF NONINFRINGEMENT, +MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. + +7. Notice to NVIDIA. You agree to notify NVIDIA in writing of any facts +or circumstances of which You later become aware that would make Your +representations in this Agreement inaccurate in any respect. + +8. Information about Submissions. You agree that contributions to Projects +and information about contributions may be maintained indefinitely and +disclosed publicly, including Your name and other information that You +submit with Your Submission. + +9. Governing Law/Jurisdiction. Claims arising under this Agreement shall +be governed by the laws of Delaware, excluding its principles of conflict +of laws and the United Nations Convention on Contracts for the Sale of +Goods. The state and/or federal courts residing in Santa Clara County, +California shall have exclusive jurisdiction over any dispute or claim +arising out of this Agreement. You may not export the Software in +violation of applicable export laws and regulations. + +10. Entire Agreement/Assignment. This Agreement is the entire agreement +between the parties, and supersedes any and all prior agreements, +understandings or communications, written or oral, between the parties +relating to the subject matter hereof. This Agreement may be assigned by +NVIDIA. + + + + +Please select one of the options below and sign as indicated. By signing, +You accept and agree to the terms of this Contribution License Agreement +for Your present and future Submissions to NVIDIA. + +___ I have sole ownership of intellectual property rights to my Submissions +and I am not making Submissions in the course of work for my employer. + +Name (“You”): _________________________________________ +Signature: _________________________________________ +Date: _________________________________________ +GitHub Login: _________________________________________ +Email: _________________________________________ +Address: _________________________________________ + +___ I am making Submissions in the course of work for my employer (or my +employer has intellectual property rights in my Submissions by contract or +applicable law). I have permission from my employer to make Submissions and +enter into this Agreement on behalf of my employer. By signing below, the +defined term “You” includes me and my employer. + +Company Name: _________________________________________ +Signature: _________________________________________ +By: _________________________________________ +Title: _________________________________________ +Date: _________________________________________ +GitHub Login: _________________________________________ +Email: _________________________________________ +Address: _________________________________________ + From f2777aee166f644f362a46118d384cbb5ba85994 Mon Sep 17 00:00:00 2001 From: Clay Gerrard Date: Mon, 1 Feb 2021 15:41:03 -0600 Subject: [PATCH 024/160] bump swift to ss-release-2.26.0.11 --- saio/container/Dockerfile | 2 +- saio/vagrant_provision.sh | 2 +- sait/vagrant_provision.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/saio/container/Dockerfile b/saio/container/Dockerfile index 41d140f31..81adbaf1e 100644 --- a/saio/container/Dockerfile +++ b/saio/container/Dockerfile @@ -3,7 +3,7 @@ FROM centos:7.4.1708 -ARG SwiftVersion=ss-release-2.26.0.10 +ARG SwiftVersion=ss-release-2.26.0.11 ARG GolangVersion=1.15.5 ARG ProxyFS_Version=stable diff --git a/saio/vagrant_provision.sh b/saio/vagrant_provision.sh index 76b672ccc..7b1ef11be 100644 --- a/saio/vagrant_provision.sh +++ b/saio/vagrant_provision.sh @@ -228,7 +228,7 @@ echo "export ST_KEY=testing" >> ~vagrant/.bash_profile cd ~swift git clone https://github.com/swiftstack/swift.git cd swift -git checkout ss-release-2.26.0.10 +git checkout ss-release-2.26.0.11 pip install wheel python setup.py bdist_wheel yum remove -y python-greenlet diff --git a/sait/vagrant_provision.sh b/sait/vagrant_provision.sh index e369f8293..cfae6e7ba 100644 --- a/sait/vagrant_provision.sh +++ b/sait/vagrant_provision.sh @@ -230,7 +230,7 @@ echo "export ST_KEY=testing" >> ~vagrant/.bash_profile cd ~swift git clone https://github.com/swiftstack/swift.git cd swift -git checkout ss-release-2.26.0.10 +git checkout ss-release-2.26.0.11 pip install wheel python setup.py bdist_wheel yum remove -y python-greenlet From 3b3cdb3530a369b724642677ef64d4426023fee9 Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Wed, 3 Feb 2021 14:04:58 -0800 Subject: [PATCH 025/160] Redirect (& unhack) movement of reference Swift fork from swiftstack to NVIDIA Also converted pfs_middleware/tox.ini to use https: instead of git:... it's a read-only repo clone anyway --- pfs_middleware/tox.ini | 2 +- saio/container/Dockerfile | 2 +- saio/vagrant_provision.sh | 2 +- sait/vagrant_provision.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pfs_middleware/tox.ini b/pfs_middleware/tox.ini index d162fedc4..f89a1de95 100644 --- a/pfs_middleware/tox.ini +++ b/pfs_middleware/tox.ini @@ -7,7 +7,7 @@ usedevelop = True deps = lint: flake8 !lint: -r{toxinidir}/test-requirements.txt - release: git+git://github.com/openstack/swift.git@2.25.1 + release: git+https://github.com/NVIDIA/swift.git@ss-release-2.26.0.11 minver: http://tarballs.openstack.org/swift/swift-2.9.0.tar.gz master: http://tarballs.openstack.org/swift/swift-master.tar.gz commands = python -m unittest discover diff --git a/saio/container/Dockerfile b/saio/container/Dockerfile index 81adbaf1e..eae3677cf 100644 --- a/saio/container/Dockerfile +++ b/saio/container/Dockerfile @@ -169,7 +169,7 @@ RUN yum install -y make fuse RUN mkdir -p $GOPATH/src/github.com/swiftstack WORKDIR $GOPATH/src/github.com/swiftstack -RUN git clone https://github.com/swiftstack/ProxyFS.git +RUN git clone https://github.com/NVIDIA/ProxyFS.git WORKDIR $GOPATH/src/github.com/swiftstack/ProxyFS RUN git checkout $ProxyFS_Version diff --git a/saio/vagrant_provision.sh b/saio/vagrant_provision.sh index 7b1ef11be..35e11daf4 100644 --- a/saio/vagrant_provision.sh +++ b/saio/vagrant_provision.sh @@ -226,7 +226,7 @@ echo "export ST_KEY=testing" >> ~vagrant/.bash_profile # Now we can actually install Swift from source cd ~swift -git clone https://github.com/swiftstack/swift.git +git clone https://github.com/NVIDIA/swift.git cd swift git checkout ss-release-2.26.0.11 pip install wheel diff --git a/sait/vagrant_provision.sh b/sait/vagrant_provision.sh index cfae6e7ba..efb425149 100644 --- a/sait/vagrant_provision.sh +++ b/sait/vagrant_provision.sh @@ -228,7 +228,7 @@ echo "export ST_KEY=testing" >> ~vagrant/.bash_profile # Now we can actually install Swift from source cd ~swift -git clone https://github.com/swiftstack/swift.git +git clone https://github.com/NVIDIA/swift.git cd swift git checkout ss-release-2.26.0.11 pip install wheel From c20fdf27df31cfe107f6202d6a452b4726feeba6 Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Wed, 3 Feb 2021 14:37:42 -0800 Subject: [PATCH 026/160] Avoid upgrade to pip 21.0 or later since Py2 support was deprecated there --- saio/container/Dockerfile | 2 +- saio/vagrant_provision.sh | 2 +- sait/vagrant_provision.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/saio/container/Dockerfile b/saio/container/Dockerfile index eae3677cf..4473b181a 100644 --- a/saio/container/Dockerfile +++ b/saio/container/Dockerfile @@ -88,7 +88,7 @@ RUN ln -s /opt/rh/rh-python36/root/usr/include /opt/rh/rh-python36/root/include RUN yum install -y epel-release RUN yum install -y python-pip -RUN pip install --upgrade pip +RUN pip install --upgrade 'pip<21.0' RUN pip install --upgrade setuptools WORKDIR /home/swift diff --git a/saio/vagrant_provision.sh b/saio/vagrant_provision.sh index 35e11daf4..d8100bd10 100644 --- a/saio/vagrant_provision.sh +++ b/saio/vagrant_provision.sh @@ -103,7 +103,7 @@ ln -s /opt/rh/rh-python36/root/usr/include /opt/rh/rh-python36/root/include yum -y install epel-release yum -y install python-pip -pip install --upgrade pip +pip install --upgrade 'pip<21.0' # Setup ProxyFS build environment diff --git a/sait/vagrant_provision.sh b/sait/vagrant_provision.sh index efb425149..e51e55649 100644 --- a/sait/vagrant_provision.sh +++ b/sait/vagrant_provision.sh @@ -105,7 +105,7 @@ ln -s /opt/rh/rh-python36/root/usr/include /opt/rh/rh-python36/root/include yum -y install epel-release yum -y install python-pip -pip install --upgrade pip +pip install --upgrade 'pip<21.0' # Setup ProxyFS build environment From 6af9838150b110cd27a0d51f0c21680c386aeb0e Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Wed, 3 Feb 2021 14:41:28 -0800 Subject: [PATCH 027/160] Missed saio/container/Dockerfile's reference to the old swift repo location --- saio/container/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/saio/container/Dockerfile b/saio/container/Dockerfile index 4473b181a..bc4c0e37d 100644 --- a/saio/container/Dockerfile +++ b/saio/container/Dockerfile @@ -109,7 +109,7 @@ RUN pip install -e . RUN pip install -r test-requirements.txt WORKDIR /home/swift -RUN git clone https://github.com/swiftstack/swift.git +RUN git clone https://github.com/NVIDIA/swift.git WORKDIR /home/swift/swift RUN git checkout $SwiftVersion RUN pip install wheel From 4017c267d62fc709d88c67553f9da34d1da50ada Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Wed, 3 Feb 2021 15:08:42 -0800 Subject: [PATCH 028/160] And the reason for the "miss" was changing the wrong repo (ProxyFS is still in swiftstack) --- saio/container/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/saio/container/Dockerfile b/saio/container/Dockerfile index bc4c0e37d..77e5f3dea 100644 --- a/saio/container/Dockerfile +++ b/saio/container/Dockerfile @@ -169,7 +169,7 @@ RUN yum install -y make fuse RUN mkdir -p $GOPATH/src/github.com/swiftstack WORKDIR $GOPATH/src/github.com/swiftstack -RUN git clone https://github.com/NVIDIA/ProxyFS.git +RUN git clone https://github.com/swiftstack/ProxyFS.git WORKDIR $GOPATH/src/github.com/swiftstack/ProxyFS RUN git checkout $ProxyFS_Version From 8995d8b4416ad64ac7a41c86e621ab36790fdb5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerard=20Gin=C3=A9?= Date: Fri, 5 Feb 2021 16:30:36 -0800 Subject: [PATCH 029/160] First batch of changes related to CI --- .travis.yml | 2 +- README.md | 25 +++++------- ci/ansible/chef_files/ci.cfg | 4 +- ci/ansible/chef_files/runway.attribs.json | 4 +- ci/ansible/chef_files/runway.cfg | 4 +- ci/ansible/chef_files/vagrant.cfg | 4 +- ci/ansible/tasks/installer_without_chef.yml | 14 +++---- .../tasks/templates/usr/bin/goswitch.template | 4 +- .../usr/bin/reprovision_proxyfs.template | 2 +- ci/ansible/vars/ci.yml | 4 +- ci/ansible/vars/runway.yml | 6 +-- ci/ansible/vars/vagrant.yml | 4 +- ci/chef.cfg | 4 +- cookbooks/meta_middleware/recipes/default.rb | 2 +- cookbooks/pfs_middleware/recipes/default.rb | 2 +- cookbooks/proxyfs/recipes/default.rb | 38 +++++++++---------- run_docker_tests.sh | 4 +- test/container/Dockerfile | 2 +- test/container/launch.sh | 2 +- 19 files changed, 62 insertions(+), 69 deletions(-) diff --git a/.travis.yml b/.travis.yml index e64ba31f8..0ccebea4b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,4 +14,4 @@ notifications: on_pull_requests: true script: -- docker run -e "COVERALLS_TOKEN=$COVERALLS_TOKEN" -e "TRAVIS_BRANCH=$TRAVIS_BRANCH" --cap-add SYS_ADMIN --device /dev/fuse -it -v `pwd`:/gopathroot/src/github.com/swiftstack/ProxyFS swiftstack/proxyfs_unit_tests +- docker run -e "COVERALLS_TOKEN=$COVERALLS_TOKEN" -e "TRAVIS_BRANCH=$TRAVIS_BRANCH" --cap-add SYS_ADMIN --device /dev/fuse -it -v `pwd`:/gopathroot/src/github.com/NVIDIA/proxyfs swiftstack/proxyfs_unit_tests diff --git a/README.md b/README.md index 3ee4da5dc..ad662f409 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![Build Status](https://travis-ci.com/swiftstack/ProxyFS.svg?branch=development)](https://travis-ci.com/swiftstack/ProxyFS) -[![Coverage Status](https://coveralls.io/repos/github/swiftstack/ProxyFS/badge.svg?branch=development)](https://coveralls.io/github/swiftstack/ProxyFS?branch=development) +[![Build Status](https://travis-ci.com/NVIDIA/proxyfs.svg?branch=development)](https://travis-ci.com/NVIDIA/proxyfs) +[![Coverage Status](https://coveralls.io/repos/github/NVIDIA/proxyfs/badge.svg?branch=development)](https://coveralls.io/github/NVIDIA/proxyfs?branch=development) # ProxyFS Integrated File and Object Access for Swift Object Storage @@ -18,7 +18,7 @@ to object API clients. All code contributions for ProxyFS go through GitHub. -https://github.com/swiftstack/ProxyFS +https://github.com/NVIDIA/proxyfs Please feel free to contribute by opening a pull request to the `development` branch. If you see an open pull request, feel free to @@ -32,28 +32,21 @@ in the [ProxyFS dev mailing list](https://lists.proxyfs.org/mailman/listinfo) or the [ProxyFS Slack group](https://proxyfs.slack.com), which you can join through [this inivitation](https://join.slack.com/t/proxyfs/shared_invite/enQtMzA2NTQwMDU4NTkyLWM4ZjhkYmE0NWEzMTYzZGZkNThkNzcxMzg0NWIzMmQ4MTU5MGQyMDRlY2UzMDU0YjBlNGZkMzk4N2NkNTRjNjY). -## Development Environment - -The officially supported development environment for ProxyFS is -[Runway](https://github.com/swiftstack/runway). Please read Runway's -documentation and make sure to use the ProxyFS manifest instead of the default -one. - -## How to get the code (if not using Runway) +## How to get the code * Define your GOPATH as desired (where your bin/, /pkg, and /src/ directory trees will appear) * cd $GOPATH -* mkdir -p src/github.com/swiftstack -* cd src/github.com/swiftstack -* git clone git@github.com:swiftstack/ProxyFS.git +* mkdir -p src/github.com/NVIDIA +* cd src/github.com/NVIDIA +* git clone git@github.com:NVIDIA/proxyfs.git * cd ProxyFS ## How to run unit tests (in your Development Environment) -* Install/update to at least Go 1.8.3 (if not using Runway) +* Install/update to at least Go 1.8.3 * Ensure $GOPATH/bin is in your $PATH -* cd $GOPATH/src/github.com/swiftstack/ProxyFS +* cd $GOPATH/src/github.com/NVIDIA/proxyfs * make ## License diff --git a/ci/ansible/chef_files/ci.cfg b/ci/ansible/chef_files/ci.cfg index 018609296..9ad6f599a 100644 --- a/ci/ansible/chef_files/ci.cfg +++ b/ci/ansible/chef_files/ci.cfg @@ -1,3 +1,3 @@ file_cache_path "/home/swiftstack/chef" -cookbook_path "/home/swiftstack/provisioning/src/github.com/swiftstack/ProxyFS/cookbooks" -json_attribs "/home/swiftstack/provisioning/src/github.com/swiftstack/ProxyFS/ci/ansible/chef_files/ci.attribs.json" +cookbook_path "/home/swiftstack/provisioning/src/github.com/NVIDIA/proxyfs/cookbooks" +json_attribs "/home/swiftstack/provisioning/src/github.com/NVIDIA/proxyfs/ci/ansible/chef_files/ci.attribs.json" diff --git a/ci/ansible/chef_files/runway.attribs.json b/ci/ansible/chef_files/runway.attribs.json index a8b584d01..9157dd64a 100644 --- a/ci/ansible/chef_files/runway.attribs.json +++ b/ci/ansible/chef_files/runway.attribs.json @@ -29,6 +29,6 @@ "swift_bench_repo": "git://github.com/openstack/swift-bench.git", "swift_bench_repo_branch": "master", "extra_key": "", - "source_root": "/home/swift/code/ProxyFS", - "package_spec_path": "/home/swift/code/ProxyFS/src/github.com/swiftstack/ProxyFS/ci/ansible/chef_files/packages" + "source_root": "/home/swift/code/proxyfs", + "package_spec_path": "/home/swift/code/proxyfs/src/github.com/NVIDIA/proxyfs/ci/ansible/chef_files/packages" } diff --git a/ci/ansible/chef_files/runway.cfg b/ci/ansible/chef_files/runway.cfg index 45ec42638..db824545d 100644 --- a/ci/ansible/chef_files/runway.cfg +++ b/ci/ansible/chef_files/runway.cfg @@ -1,3 +1,3 @@ file_cache_path "/home/swift/chef" -cookbook_path "/home/swift/code/ProxyFS/src/github.com/swiftstack/ProxyFS/cookbooks" -json_attribs "/home/swift/code/ProxyFS/src/github.com/swiftstack/ProxyFS/ci/ansible/chef_files/runway.attribs.json" +cookbook_path "/home/swift/code/proxyfs/src/github.com/NVIDIA/proxyfs/cookbooks" +json_attribs "/home/swift/code/proxyfs/src/github.com/NVIDIA/proxyfs/ci/ansible/chef_files/runway.attribs.json" diff --git a/ci/ansible/chef_files/vagrant.cfg b/ci/ansible/chef_files/vagrant.cfg index 4d63a47ff..cbd9bfe53 100644 --- a/ci/ansible/chef_files/vagrant.cfg +++ b/ci/ansible/chef_files/vagrant.cfg @@ -1,3 +1,3 @@ file_cache_path "/home/vagrant/chef" -cookbook_path "/vagrant/src/github.com/swiftstack/ProxyFS/cookbooks" -json_attribs "/vagrant/src/github.com/swiftstack/ProxyFS/ci/ansible/chef_files/vagrant.attribs.json" +cookbook_path "/vagrant/src/github.com/NVIDIA/proxyfs/cookbooks" +json_attribs "/vagrant/src/github.com/NVIDIA/proxyfs/ci/ansible/chef_files/vagrant.attribs.json" diff --git a/ci/ansible/tasks/installer_without_chef.yml b/ci/ansible/tasks/installer_without_chef.yml index ac45b8d74..71f018fbc 100644 --- a/ci/ansible/tasks/installer_without_chef.yml +++ b/ci/ansible/tasks/installer_without_chef.yml @@ -13,9 +13,9 @@ GOROOT: "/usr/local/go" HOME_DIR: "/home/{{ proxyfs_user }}" BASH_DOT_PROFILE: "{{ ansible_env.HOME }}/.bash_profile" - REPO_CLONE_PARENT_DIR: "{{ source_root }}/src/github.com/swiftstack" + REPO_CLONE_PARENT_DIR: "{{ source_root }}/src/github.com/NVIDIA" SAMBA_SRC_DIR: "{{ REPO_CLONE_PARENT_DIR }}/samba" - PROXYFS_SRC_DIR: "{{ REPO_CLONE_PARENT_DIR }}/ProxyFS" + PROXYFS_SRC_DIR: "{{ REPO_CLONE_PARENT_DIR }}/proxyfs" dot_bashrc: "{{ HOME_DIR }}/.bashrc" is_dev: False rhel_packages: @@ -50,14 +50,14 @@ tasks: - name: Clone ProxyFS repo git: - repo: https://github.com/swiftstack/ProxyFS.git + repo: https://github.com/NVIDIA/proxyfs.git dest: "{{ PROXYFS_SRC_DIR }}/" version: "{{ ansible_env.proxyfs_branch }}" - name: Install pfs_middleware in development mode shell: "python setup.py develop" args: - chdir: "{{ ansible_env.HOME }}/provisioning/github.com/swiftstack/ProxyFS/pfs_middleware" + chdir: "{{ ansible_env.HOME }}/provisioning/github.com/NVIDIA/proxyfs/pfs_middleware" - stat: path={{GOROOT}} register: go_installed @@ -105,7 +105,7 @@ create: True owner: {{proxyfs_user}} with_items: - - {regexp: "/cdpfs/", line: "alias cdpfs='cd $GOPATH/src/github.com/swiftstack/ProxyFS'"} + - {regexp: "/cdpfs/", line: "alias cdpfs='cd $GOPATH/src/github.com/NVIDIA/proxyfs'"} - {regexp: "/cdsamba/", line: "alias cdsamba='cd {{SAMBA_SRC_DIR}}'"} - name: "Disable SELinux" @@ -154,7 +154,7 @@ - name: "Link to proxyfsd" file: - src: "{{source_root}}/src/github.com/swiftstack/ProxyFS/proxyfsd/" + src: "{{source_root}}/src/github.com/NVIDIA/proxyfs/proxyfsd/" dest: "/etc/proxyfsd" state: link owner: {{proxyfs_user}} @@ -168,7 +168,7 @@ mode: 0755 - name: "Provision pfs_stat" - shell: "install -m 0755 {{source_root}}/src/github.com/swiftstack/ProxyFS/bin/pfs_stat /usr/bin" + shell: "install -m 0755 {{source_root}}/src/github.com/NVIDIA/proxyfs/bin/pfs_stat /usr/bin" - stat: path=/usr/lib/systemd/system/ register: system_exists diff --git a/ci/ansible/tasks/templates/usr/bin/goswitch.template b/ci/ansible/tasks/templates/usr/bin/goswitch.template index 9aa5ed288..368ebd9fa 100644 --- a/ci/ansible/tasks/templates/usr/bin/goswitch.template +++ b/ci/ansible/tasks/templates/usr/bin/goswitch.template @@ -14,9 +14,9 @@ GO_DIR_NAME = "{{ go_dir_name }}" GO_DIR_PATH = os.path.join(GO_DIR_PARENT_PATH, GO_DIR_NAME) SOURCE_ROOT = "{{ source_root }}" REPO_CLONE_PARENT_DIR = os.path.join( - SOURCE_ROOT, "src", "github.com", "swiftstack" + SOURCE_ROOT, "src", "github.com", "NVIDIA" ) -PROXYFS_SRC_DIR = os.path.join(REPO_CLONE_PARENT_DIR, "ProxyFS") +PROXYFS_SRC_DIR = os.path.join(REPO_CLONE_PARENT_DIR, "proxyfs") class GoDirNotLinkError(Exception): diff --git a/ci/ansible/tasks/templates/usr/bin/reprovision_proxyfs.template b/ci/ansible/tasks/templates/usr/bin/reprovision_proxyfs.template index 07f6a375d..1f3fe4e43 100644 --- a/ci/ansible/tasks/templates/usr/bin/reprovision_proxyfs.template +++ b/ci/ansible/tasks/templates/usr/bin/reprovision_proxyfs.template @@ -2,6 +2,6 @@ set -e /usr/bin/unmount_and_stop_pfs -cd $GOPATH/src/github.com/swiftstack/ProxyFS +cd $GOPATH/src/github.com/NVIDIA/proxyfs ci/ansible/install_proxyfs.sh {{ env_arg }} {{ active_golang_version }} /usr/bin/start_and_mount_pfs "$@" diff --git a/ci/ansible/vars/ci.yml b/ci/ansible/vars/ci.yml index 787b43626..8ba350bb7 100644 --- a/ci/ansible/vars/ci.yml +++ b/ci/ansible/vars/ci.yml @@ -2,5 +2,5 @@ proxyfs_user: "swiftstack" proxyfs_group: "swiftsatck" source_root: "/home/{{ proxyfs_user }}/provisioning" -REPO_CLONE_PARENT_DIR: "{{ source_root }}/src/github.com/swiftstack" -PROXYFS_SRC_DIR: "{{ REPO_CLONE_PARENT_DIR }}/ProxyFS" +REPO_CLONE_PARENT_DIR: "{{ source_root }}/src/github.com/NVIDIA" +PROXYFS_SRC_DIR: "{{ REPO_CLONE_PARENT_DIR }}/proxyfs" diff --git a/ci/ansible/vars/runway.yml b/ci/ansible/vars/runway.yml index d094123b9..b54c163d7 100644 --- a/ci/ansible/vars/runway.yml +++ b/ci/ansible/vars/runway.yml @@ -1,6 +1,6 @@ --- proxyfs_user: "swift" proxyfs_group: "swift" -source_root: "/home/{{ proxyfs_user }}/code/ProxyFS" -REPO_CLONE_PARENT_DIR: "{{ source_root }}/src/github.com/swiftstack" -PROXYFS_SRC_DIR: "{{ REPO_CLONE_PARENT_DIR }}/ProxyFS" +source_root: "/home/{{ proxyfs_user }}/code/proxyfs" +REPO_CLONE_PARENT_DIR: "{{ source_root }}/src/github.com/NVIDIA" +PROXYFS_SRC_DIR: "{{ REPO_CLONE_PARENT_DIR }}/proxyfs" diff --git a/ci/ansible/vars/vagrant.yml b/ci/ansible/vars/vagrant.yml index 8e7c76a23..545723ff2 100644 --- a/ci/ansible/vars/vagrant.yml +++ b/ci/ansible/vars/vagrant.yml @@ -2,5 +2,5 @@ proxyfs_user: "vagrant" proxyfs_group: "vagrant" source_root: "/vagrant" -REPO_CLONE_PARENT_DIR: "{{ source_root }}/src/github.com/swiftstack" -PROXYFS_SRC_DIR: "{{ REPO_CLONE_PARENT_DIR }}/ProxyFS" +REPO_CLONE_PARENT_DIR: "{{ source_root }}/src/github.com/NVIDIA" +PROXYFS_SRC_DIR: "{{ REPO_CLONE_PARENT_DIR }}/proxyfs" diff --git a/ci/chef.cfg b/ci/chef.cfg index 749d279ed..501a8d758 100644 --- a/ci/chef.cfg +++ b/ci/chef.cfg @@ -1,3 +1,3 @@ file_cache_path "/home/swiftstack/chef" -cookbook_path "/home/swiftstack/provisioning/src/github.com/swiftstack/ProxyFS/cookbooks" -json_attribs "/home/swiftstack/provisioning/src/github.com/swiftstack/ProxyFS/ci/chef.attribs.json" +cookbook_path "/home/swiftstack/provisioning/src/github.com/NVIDIA/proxyfs/cookbooks" +json_attribs "/home/swiftstack/provisioning/src/github.com/NVIDIA/proxyfs/ci/chef.attribs.json" diff --git a/cookbooks/meta_middleware/recipes/default.rb b/cookbooks/meta_middleware/recipes/default.rb index 37ca6eae6..bea0435e2 100644 --- a/cookbooks/meta_middleware/recipes/default.rb +++ b/cookbooks/meta_middleware/recipes/default.rb @@ -8,5 +8,5 @@ # install middleware in development mode execute 'meta_middleware - setup.py develop' do command "python setup.py develop" - cwd "#{node['source_root']}/src/github.com/swiftstack/ProxyFS/meta_middleware" + cwd "#{node['source_root']}/src/github.com/NVIDIA/proxyfs/meta_middleware" end diff --git a/cookbooks/pfs_middleware/recipes/default.rb b/cookbooks/pfs_middleware/recipes/default.rb index fa32d4a73..9da1519b1 100644 --- a/cookbooks/pfs_middleware/recipes/default.rb +++ b/cookbooks/pfs_middleware/recipes/default.rb @@ -8,5 +8,5 @@ # install middleware in development mode execute 'pfs_middleware - setup.py develop' do command "python setup.py develop" - cwd "#{node['source_root']}/src/github.com/swiftstack/ProxyFS/pfs_middleware" + cwd "#{node['source_root']}/src/github.com/NVIDIA/proxyfs/pfs_middleware" end diff --git a/cookbooks/proxyfs/recipes/default.rb b/cookbooks/proxyfs/recipes/default.rb index e09a75be5..f85186439 100644 --- a/cookbooks/proxyfs/recipes/default.rb +++ b/cookbooks/proxyfs/recipes/default.rb @@ -12,9 +12,9 @@ ROOT_DOT_BASH_PROFILE = "/root/.bash_profile" ROOT_DOT_BASHRC = "/root/.bashrc" ETC_BASHRC = "/etc/bashrc" -REPO_CLONE_PARENT_DIR = "#{source_root}/src/github.com/swiftstack" +REPO_CLONE_PARENT_DIR = "#{source_root}/src/github.com/NVIDIA" PROXYFS_BIN_DIR = "#{source_root}/bin" -PROXYFS_SRC_DIR = "#{REPO_CLONE_PARENT_DIR}/ProxyFS" +PROXYFS_SRC_DIR = "#{REPO_CLONE_PARENT_DIR}/proxyfs" ruby_block "update_profile_and_bashrc" do block do @@ -49,7 +49,7 @@ file = Chef::Util::FileEdit.new(DOT_BASHRC) file.insert_line_if_no_match(/export GOPATH/, "export GOPATH=#{source_root}") file.insert_line_if_no_match(%r{usr/local/go/bin}, "export PATH=$GOPATH/bin:$PATH:/usr/local/go/bin") - file.insert_line_if_no_match(/cdpfs/, "alias cdpfs='cd $GOPATH/src/github.com/swiftstack/ProxyFS'") + file.insert_line_if_no_match(/cdpfs/, "alias cdpfs='cd $GOPATH/src/github.com/NVIDIA/proxyfs'") file.insert_line_if_no_match(/cdfun/, "alias cdfun='cd /home/swift/code/functional-tests'") file.insert_line_if_no_match(/ls -lha/, "alias la='ls -lha'") file.insert_line_if_no_match(/ls -liha/, "alias li='ls -liha'") @@ -79,7 +79,7 @@ file = Chef::Util::FileEdit.new(ROOT_DOT_BASHRC) file.insert_line_if_no_match(/export GOPATH/, "export GOPATH=#{source_root}") file.insert_line_if_no_match(%r{usr/local/go/bin}, "export PATH=$GOPATH/bin:$PATH:/usr/local/go/bin") - file.insert_line_if_no_match(/cdpfs/, "alias cdpfs='cd $GOPATH/src/github.com/swiftstack/ProxyFS'") + file.insert_line_if_no_match(/cdpfs/, "alias cdpfs='cd $GOPATH/src/github.com/NVIDIA/proxyfs'") file.insert_line_if_no_match(/cdfun/, "alias cdfun='cd /home/swift/code/functional-tests'") file.insert_line_if_no_match(/ls -lha/, "alias la='ls -lha'") file.insert_line_if_no_match(/ls -liha/, "alias li='ls -liha'") @@ -118,12 +118,12 @@ command "pip install -r #{PROXYFS_SRC_DIR}/pfs-swift-load/requirements.txt" end -execute "Create ProxyFS/bin dir" do +execute "Create proxyfs/bin dir" do command "mkdir #{PROXYFS_BIN_DIR}" not_if { ::Dir.exists?("#{PROXYFS_BIN_DIR}") } end -execute "Copy pfs-swift-load-plot at /home/swift/code/ProxyFS/bin/" do +execute "Copy pfs-swift-load-plot at /home/swift/code/proxyfs/bin/" do command "install -m 0755 #{PROXYFS_SRC_DIR}/pfs-swift-load/pfs-swift-load-plot #{PROXYFS_BIN_DIR}/" end @@ -167,61 +167,61 @@ end link '/etc/proxyfsd' do - to "#{source_root}/src/github.com/swiftstack/ProxyFS/proxyfsd/" + to "#{source_root}/src/github.com/NVIDIA/proxyfs/proxyfsd/" link_type :symbolic owner proxyfs_user group proxyfs_group end link '/etc/pfsagentd' do - to "#{source_root}/src/github.com/swiftstack/ProxyFS/pfsagentd/" + to "#{source_root}/src/github.com/NVIDIA/proxyfs/pfsagentd/" link_type :symbolic owner proxyfs_user group proxyfs_group end execute "Provision start_and_mount_pfs" do - command "install -m 0755 #{source_root}/src/github.com/swiftstack/ProxyFS/cookbooks/proxyfs/files/default/usr/bin/start_and_mount_pfs /usr/bin" + command "install -m 0755 #{source_root}/src/github.com/NVIDIA/proxyfs/cookbooks/proxyfs/files/default/usr/bin/start_and_mount_pfs /usr/bin" end execute "Provision start_swift_only" do - command "install -m 0755 #{source_root}/src/github.com/swiftstack/ProxyFS/cookbooks/proxyfs/files/default/usr/bin/start_swift_only /usr/bin" + command "install -m 0755 #{source_root}/src/github.com/NVIDIA/proxyfs/cookbooks/proxyfs/files/default/usr/bin/start_swift_only /usr/bin" end execute "Provision start_proxyfsd_only" do - command "install -m 0755 #{source_root}/src/github.com/swiftstack/ProxyFS/cookbooks/proxyfs/files/default/usr/bin/start_proxyfsd_only /usr/bin" + command "install -m 0755 #{source_root}/src/github.com/NVIDIA/proxyfs/cookbooks/proxyfs/files/default/usr/bin/start_proxyfsd_only /usr/bin" end execute "Provision stop_proxyfsd_only" do - command "install -m 0755 #{source_root}/src/github.com/swiftstack/ProxyFS/cookbooks/proxyfs/files/default/usr/bin/stop_proxyfsd_only /usr/bin" + command "install -m 0755 #{source_root}/src/github.com/NVIDIA/proxyfs/cookbooks/proxyfs/files/default/usr/bin/stop_proxyfsd_only /usr/bin" end execute "Provision unmount_and_stop_pfs" do - command "install -m 0755 #{source_root}/src/github.com/swiftstack/ProxyFS/cookbooks/proxyfs/files/default/usr/bin/unmount_and_stop_pfs /usr/bin" + command "install -m 0755 #{source_root}/src/github.com/NVIDIA/proxyfs/cookbooks/proxyfs/files/default/usr/bin/unmount_and_stop_pfs /usr/bin" end execute "Provision set_up_s3api" do - command "install -m 0755 #{source_root}/src/github.com/swiftstack/ProxyFS/cookbooks/proxyfs/files/default/usr/bin/set_up_s3api /usr/bin" + command "install -m 0755 #{source_root}/src/github.com/NVIDIA/proxyfs/cookbooks/proxyfs/files/default/usr/bin/set_up_s3api /usr/bin" end execute "Provision set_up_swift3" do - command "install -m 0755 #{source_root}/src/github.com/swiftstack/ProxyFS/cookbooks/proxyfs/files/default/usr/bin/set_up_swift3 /usr/bin" + command "install -m 0755 #{source_root}/src/github.com/NVIDIA/proxyfs/cookbooks/proxyfs/files/default/usr/bin/set_up_swift3 /usr/bin" end execute "Provision enable_s3" do - command "install -m 0755 #{source_root}/src/github.com/swiftstack/ProxyFS/cookbooks/proxyfs/files/default/usr/bin/enable_s3 /usr/bin" + command "install -m 0755 #{source_root}/src/github.com/NVIDIA/proxyfs/cookbooks/proxyfs/files/default/usr/bin/enable_s3 /usr/bin" end execute "Provision disable_s3" do - command "install -m 0755 #{source_root}/src/github.com/swiftstack/ProxyFS/cookbooks/proxyfs/files/default/usr/bin/disable_s3 /usr/bin" + command "install -m 0755 #{source_root}/src/github.com/NVIDIA/proxyfs/cookbooks/proxyfs/files/default/usr/bin/disable_s3 /usr/bin" end execute "Provision detect_s3" do - command "install -m 0755 #{source_root}/src/github.com/swiftstack/ProxyFS/cookbooks/proxyfs/files/default/usr/bin/detect_s3 /usr/bin" + command "install -m 0755 #{source_root}/src/github.com/NVIDIA/proxyfs/cookbooks/proxyfs/files/default/usr/bin/detect_s3 /usr/bin" end execute "Provision pfs_stat" do - command "install -m 0755 #{source_root}/src/github.com/swiftstack/ProxyFS/bin/pfs_stat /usr/bin" + command "install -m 0755 #{source_root}/src/github.com/NVIDIA/proxyfs/bin/pfs_stat /usr/bin" end cookbook_file "/usr/lib/systemd/system/proxyfsd.service" do diff --git a/run_docker_tests.sh b/run_docker_tests.sh index f41cadebb..da306674a 100755 --- a/run_docker_tests.sh +++ b/run_docker_tests.sh @@ -17,11 +17,11 @@ if [ "$IMAGE" == "build" ]; then set -x # That's how you run it from scratch docker build -t proxyfs_unit_tests test/container - docker run --cap-add SYS_ADMIN --device /dev/fuse -it -v `pwd`:/gopathroot/src/github.com/swiftstack/ProxyFS proxyfs_unit_tests + docker run --cap-add SYS_ADMIN --device /dev/fuse -it -v `pwd`:/gopathroot/src/github.com/NVIDIA/proxyfs proxyfs_unit_tests elif [ "$IMAGE" == "pull" ]; then set -x # That's how you run it using the image on Docker Hub - docker run --cap-add SYS_ADMIN --device /dev/fuse -it -v `pwd`:/gopathroot/src/github.com/swiftstack/ProxyFS swiftstack/proxyfs_unit_tests + docker run --cap-add SYS_ADMIN --device /dev/fuse -it -v `pwd`:/gopathroot/src/github.com/NVIDIA/proxyfs swiftstack/proxyfs_unit_tests else echo "Bad argument: $IMAGE" exit 1 diff --git a/test/container/Dockerfile b/test/container/Dockerfile index 589fcdf68..de5555529 100644 --- a/test/container/Dockerfile +++ b/test/container/Dockerfile @@ -127,4 +127,4 @@ RUN cd /pyeclib && pip install -e . && pip install -r test-requirements.txt RUN go get github.com/ory/go-acc github.com/mattn/goveralls -CMD ["/bin/bash", "/gopathroot/src/github.com/swiftstack/ProxyFS/test/container/launch.sh"] +CMD ["/bin/bash", "/gopathroot/src/github.com/NVIDIA/proxyfs/test/container/launch.sh"] diff --git a/test/container/launch.sh b/test/container/launch.sh index 4df25c0d8..c22b9a90e 100755 --- a/test/container/launch.sh +++ b/test/container/launch.sh @@ -7,7 +7,7 @@ set -e set -x # Build ProxyFS and run tests -cd $GOPATH/src/github.com/swiftstack/ProxyFS +cd $GOPATH/src/github.com/NVIDIA/proxyfs make ci # $COVERALLS_TOKEN must be configured in TravisCI if [ -n "$COVERALLS_TOKEN" ] && [ -n "$TRAVIS_BRANCH" ]; then From ee47ff879f62ec74e4fd9c006bee9fcc854dc794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerard=20Gin=C3=A9?= Date: Fri, 5 Feb 2021 16:38:59 -0800 Subject: [PATCH 030/160] Remove TravisCI badges --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index ad662f409..ca2277677 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,3 @@ -[![Build Status](https://travis-ci.com/NVIDIA/proxyfs.svg?branch=development)](https://travis-ci.com/NVIDIA/proxyfs) -[![Coverage Status](https://coveralls.io/repos/github/NVIDIA/proxyfs/badge.svg?branch=development)](https://coveralls.io/github/NVIDIA/proxyfs?branch=development) - # ProxyFS Integrated File and Object Access for Swift Object Storage From d22201d9531eea818adb724633dfbdfcf4aeb62c Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Mon, 8 Feb 2021 10:00:44 -0800 Subject: [PATCH 031/160] Migrated all Makefile's --- Makefile | 2 +- blunder/Makefile | 2 +- bucketstats/Makefile | 2 +- cleanproxyfs/Makefile | 2 +- conf/Makefile | 2 +- confgen/Makefile | 2 +- confgen/confgen/Makefile | 2 +- dlm/Makefile | 2 +- emswift/Makefile | 2 +- emswift/emswiftpkg/Makefile | 2 +- etcdclient/Makefile | 2 +- evtlog/Makefile | 2 +- evtlog/pfsevtlogd/Makefile | 2 +- fs/Makefile | 2 +- fsworkout/Makefile | 2 +- fuse/Makefile | 2 +- halter/Makefile | 2 +- headhunter/Makefile | 2 +- httpserver/Makefile | 2 +- imgr/Makefile | 2 +- imgr/imgrpkg/Makefile | 2 +- inode/Makefile | 2 +- inodeworkout/Makefile | 2 +- jrpcfs/Makefile | 2 +- jrpcfs/test/Makefile | 2 +- liveness/Makefile | 2 +- logger/Makefile | 2 +- make-static-content/Makefile | 2 +- mkproxyfs/Makefile | 2 +- mkproxyfs/mkproxyfs/Makefile | 2 +- pfs-crash/Makefile | 2 +- pfs-fsck/Makefile | 2 +- pfs-jrpc/Makefile | 2 +- pfs-restart-test/Makefile | 2 +- pfs-stress/Makefile | 2 +- pfs-swift-load/Makefile | 2 +- pfsagentConfig/Makefile | 2 +- pfsagentConfig/pfsagentConfig/Makefile | 2 +- pfsagentd/Makefile | 2 +- pfsagentd/pfsagentd-init/Makefile | 2 +- pfsagentd/pfsagentd-swift-auth-plugin/Makefile | 2 +- pfsconfjson/Makefile | 2 +- pfsconfjsonpacked/Makefile | 2 +- pfsworkout/Makefile | 2 +- platform/Makefile | 2 +- proxyfsd/Makefile | 2 +- proxyfsd/proxyfsd/Makefile | 2 +- ramswift/Makefile | 2 +- ramswift/ramswift/Makefile | 2 +- retryrpc/Makefile | 2 +- retryrpc/rpctest/Makefile | 2 +- stats/Makefile | 2 +- statslogger/Makefile | 2 +- swiftclient/Makefile | 2 +- trackedlock/Makefile | 2 +- transitions/Makefile | 2 +- utils/Makefile | 2 +- version/Makefile | 2 +- 58 files changed, 58 insertions(+), 58 deletions(-) diff --git a/Makefile b/Makefile index e78d746ad..f7462c9d2 100644 --- a/Makefile +++ b/Makefile @@ -72,7 +72,7 @@ gobinsubdirsforci = \ proxyfsd/proxyfsd gosubdirsforci = $(gopkgsubdirs) $(gobinsubdirsforci); -gosubdirspathsforci = $(addprefix github.com/swiftstack/ProxyFS/,$(gosubdirsforci)) +gosubdirspathsforci = $(addprefix github.com/NVIDIA/proxyfs/,$(gosubdirsforci)) uname = $(shell uname) machine = $(shell uname -m) diff --git a/blunder/Makefile b/blunder/Makefile index 3710054cd..9466c3178 100644 --- a/blunder/Makefile +++ b/blunder/Makefile @@ -1,7 +1,7 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/blunder +gosubdir := github.com/NVIDIA/proxyfs/blunder generatedfiles := \ fserror_string.go diff --git a/bucketstats/Makefile b/bucketstats/Makefile index 27605ff0e..7d2f51140 100644 --- a/bucketstats/Makefile +++ b/bucketstats/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/bucketstats +gosubdir := github.com/NVIDIA/proxyfs/bucketstats include ../GoMakefile diff --git a/cleanproxyfs/Makefile b/cleanproxyfs/Makefile index 4fdd5b0b7..381b9e6e9 100644 --- a/cleanproxyfs/Makefile +++ b/cleanproxyfs/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/cleanproxyfs +gosubdir := github.com/NVIDIA/proxyfs/cleanproxyfs include ../GoMakefile diff --git a/conf/Makefile b/conf/Makefile index 201b26edc..aaae46c26 100644 --- a/conf/Makefile +++ b/conf/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/conf +gosubdir := github.com/NVIDIA/proxyfs/conf include ../GoMakefile diff --git a/confgen/Makefile b/confgen/Makefile index 0b00720c2..d63911273 100644 --- a/confgen/Makefile +++ b/confgen/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/confgen +gosubdir := github.com/NVIDIA/proxyfs/confgen include ../GoMakefile diff --git a/confgen/confgen/Makefile b/confgen/confgen/Makefile index ed0c48a2b..073b6b37d 100644 --- a/confgen/confgen/Makefile +++ b/confgen/confgen/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/confgen/confgen +gosubdir := github.com/NVIDIA/proxyfs/confgen/confgen include ../../GoMakefile diff --git a/dlm/Makefile b/dlm/Makefile index 4018099be..f54a4b861 100644 --- a/dlm/Makefile +++ b/dlm/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/dlm +gosubdir := github.com/NVIDIA/proxyfs/dlm include ../GoMakefile diff --git a/emswift/Makefile b/emswift/Makefile index 74b2d5323..1deda5018 100644 --- a/emswift/Makefile +++ b/emswift/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/emswift +gosubdir := github.com/NVIDIA/proxyfs/emswift include ../GoMakefile diff --git a/emswift/emswiftpkg/Makefile b/emswift/emswiftpkg/Makefile index e40813d02..ee8ca60de 100644 --- a/emswift/emswiftpkg/Makefile +++ b/emswift/emswiftpkg/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/emswift/emswiftpkg +gosubdir := github.com/NVIDIA/proxyfs/emswift/emswiftpkg include ../../GoMakefile diff --git a/etcdclient/Makefile b/etcdclient/Makefile index 41aba670b..302c61c44 100644 --- a/etcdclient/Makefile +++ b/etcdclient/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/etcdclient +gosubdir := github.com/NVIDIA/proxyfs/etcdclient include ../GoMakefile diff --git a/evtlog/Makefile b/evtlog/Makefile index 8520cb99c..54a10b7a7 100644 --- a/evtlog/Makefile +++ b/evtlog/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/evtlog +gosubdir := github.com/NVIDIA/proxyfs/evtlog include ../GoMakefile diff --git a/evtlog/pfsevtlogd/Makefile b/evtlog/pfsevtlogd/Makefile index d86ae15e0..f9804187f 100644 --- a/evtlog/pfsevtlogd/Makefile +++ b/evtlog/pfsevtlogd/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/evtlog/pfsevtlogd +gosubdir := github.com/NVIDIA/proxyfs/evtlog/pfsevtlogd include ../../GoMakefile diff --git a/fs/Makefile b/fs/Makefile index 9ea8bf26a..cb3621560 100644 --- a/fs/Makefile +++ b/fs/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/fs +gosubdir := github.com/NVIDIA/proxyfs/fs include ../GoMakefile diff --git a/fsworkout/Makefile b/fsworkout/Makefile index b952ccda5..29e827699 100644 --- a/fsworkout/Makefile +++ b/fsworkout/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/fsworkout +gosubdir := github.com/NVIDIA/proxyfs/fsworkout include ../GoMakefile diff --git a/fuse/Makefile b/fuse/Makefile index 08f887e2e..38e27e074 100644 --- a/fuse/Makefile +++ b/fuse/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/fuse +gosubdir := github.com/NVIDIA/proxyfs/fuse include ../GoMakefile diff --git a/halter/Makefile b/halter/Makefile index cdafa6665..0f9999ec2 100644 --- a/halter/Makefile +++ b/halter/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/halter +gosubdir := github.com/NVIDIA/proxyfs/halter include ../GoMakefile diff --git a/headhunter/Makefile b/headhunter/Makefile index faeee50b5..a5302e8b0 100644 --- a/headhunter/Makefile +++ b/headhunter/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/headhunter +gosubdir := github.com/NVIDIA/proxyfs/headhunter include ../GoMakefile diff --git a/httpserver/Makefile b/httpserver/Makefile index 3b3143213..1f29bddd5 100644 --- a/httpserver/Makefile +++ b/httpserver/Makefile @@ -1,7 +1,7 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/httpserver +gosubdir := github.com/NVIDIA/proxyfs/httpserver generatedfiles := \ bootstrap_dot_min_dot_css_.go \ diff --git a/imgr/Makefile b/imgr/Makefile index f699a7896..8eace0306 100644 --- a/imgr/Makefile +++ b/imgr/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/imgr +gosubdir := github.com/NVIDIA/proxyfs/imgr include ../GoMakefile diff --git a/imgr/imgrpkg/Makefile b/imgr/imgrpkg/Makefile index 9fe6f3f1e..a2b7d2743 100644 --- a/imgr/imgrpkg/Makefile +++ b/imgr/imgrpkg/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/imgr/imgrpkg +gosubdir := github.com/NVIDIA/proxyfs/imgr/imgrpkg include ../../GoMakefile diff --git a/inode/Makefile b/inode/Makefile index 1e5093a83..1122a376b 100644 --- a/inode/Makefile +++ b/inode/Makefile @@ -1,7 +1,7 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/inode +gosubdir := github.com/NVIDIA/proxyfs/inode generatedfiles := \ inodetype_string.go diff --git a/inodeworkout/Makefile b/inodeworkout/Makefile index f10219ffc..381033738 100644 --- a/inodeworkout/Makefile +++ b/inodeworkout/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/inodeworkout +gosubdir := github.com/NVIDIA/proxyfs/inodeworkout include ../GoMakefile diff --git a/jrpcfs/Makefile b/jrpcfs/Makefile index d7ef57f80..37cc18439 100644 --- a/jrpcfs/Makefile +++ b/jrpcfs/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/jrpcfs +gosubdir := github.com/NVIDIA/proxyfs/jrpcfs include ../GoMakefile diff --git a/jrpcfs/test/Makefile b/jrpcfs/test/Makefile index 46e13461f..8c3d6a4a6 100644 --- a/jrpcfs/test/Makefile +++ b/jrpcfs/test/Makefile @@ -3,7 +3,7 @@ CC=gcc CFLAGS=-I. -JSON_C_DIR=/Users/kmalone/code/gowork/src/github.com/swiftstack/samba/json-c +JSON_C_DIR=/Users/kmalone/code/gowork/src/github.com/NVIDIA/samba/json-c CFLAGS += -I $(JSON_C_DIR)/include/json-c LDFLAGS+= -L $(JSON_C_DIR)/lib -ljson-c DEPS = diff --git a/liveness/Makefile b/liveness/Makefile index 23e81fd77..b18e1302f 100644 --- a/liveness/Makefile +++ b/liveness/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/liveness +gosubdir := github.com/NVIDIA/proxyfs/liveness include ../GoMakefile diff --git a/logger/Makefile b/logger/Makefile index 7738b86e0..369af8406 100644 --- a/logger/Makefile +++ b/logger/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/logger +gosubdir := github.com/NVIDIA/proxyfs/logger include ../GoMakefile diff --git a/make-static-content/Makefile b/make-static-content/Makefile index 92a9b4209..e70a62277 100644 --- a/make-static-content/Makefile +++ b/make-static-content/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/make-static-content +gosubdir := github.com/NVIDIA/proxyfs/make-static-content include ../GoMakefile diff --git a/mkproxyfs/Makefile b/mkproxyfs/Makefile index 7c4ac9128..fd2018643 100644 --- a/mkproxyfs/Makefile +++ b/mkproxyfs/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/mkproxyfs +gosubdir := github.com/NVIDIA/proxyfs/mkproxyfs include ../GoMakefile diff --git a/mkproxyfs/mkproxyfs/Makefile b/mkproxyfs/mkproxyfs/Makefile index 4cb5486f4..66c1094a4 100644 --- a/mkproxyfs/mkproxyfs/Makefile +++ b/mkproxyfs/mkproxyfs/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/mkproxyfs/mkproxyfs +gosubdir := github.com/NVIDIA/proxyfs/mkproxyfs/mkproxyfs include ../../GoMakefile diff --git a/pfs-crash/Makefile b/pfs-crash/Makefile index 29b1e3fb1..20de57d27 100644 --- a/pfs-crash/Makefile +++ b/pfs-crash/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/pfs-crash +gosubdir := github.com/NVIDIA/proxyfs/pfs-crash include ../GoMakefile diff --git a/pfs-fsck/Makefile b/pfs-fsck/Makefile index c8238cc79..e8e6dce1c 100644 --- a/pfs-fsck/Makefile +++ b/pfs-fsck/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/pfs-fsck +gosubdir := github.com/NVIDIA/proxyfs/pfs-fsck include ../GoMakefile diff --git a/pfs-jrpc/Makefile b/pfs-jrpc/Makefile index c1533ec88..741445ad4 100644 --- a/pfs-jrpc/Makefile +++ b/pfs-jrpc/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/pfs-jrpc +gosubdir := github.com/NVIDIA/proxyfs/pfs-jrpc include ../GoMakefile diff --git a/pfs-restart-test/Makefile b/pfs-restart-test/Makefile index e493afa18..83b2e56c8 100644 --- a/pfs-restart-test/Makefile +++ b/pfs-restart-test/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/pfs-restart-test +gosubdir := github.com/NVIDIA/proxyfs/pfs-restart-test include ../GoMakefile diff --git a/pfs-stress/Makefile b/pfs-stress/Makefile index a3239593e..48c005561 100644 --- a/pfs-stress/Makefile +++ b/pfs-stress/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/pfs-stress +gosubdir := github.com/NVIDIA/proxyfs/pfs-stress include ../GoMakefile diff --git a/pfs-swift-load/Makefile b/pfs-swift-load/Makefile index d6a7ad42f..fdcb9dc14 100644 --- a/pfs-swift-load/Makefile +++ b/pfs-swift-load/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/pfs-swift-load +gosubdir := github.com/NVIDIA/proxyfs/pfs-swift-load include ../GoMakefile diff --git a/pfsagentConfig/Makefile b/pfsagentConfig/Makefile index 431d5a9cb..1ae0a6c6b 100644 --- a/pfsagentConfig/Makefile +++ b/pfsagentConfig/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/pfsagentConfig +gosubdir := github.com/NVIDIA/proxyfs/pfsagentConfig include ../GoMakefile diff --git a/pfsagentConfig/pfsagentConfig/Makefile b/pfsagentConfig/pfsagentConfig/Makefile index 65670235e..d43c7af26 100644 --- a/pfsagentConfig/pfsagentConfig/Makefile +++ b/pfsagentConfig/pfsagentConfig/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/pfsagentConfig/pfsagentConfig +gosubdir := github.com/NVIDIA/proxyfs/pfsagentConfig/pfsagentConfig include ../../GoMakefile diff --git a/pfsagentd/Makefile b/pfsagentd/Makefile index f0e2f3226..d49ed7722 100644 --- a/pfsagentd/Makefile +++ b/pfsagentd/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/pfsagentd +gosubdir := github.com/NVIDIA/proxyfs/pfsagentd include ../GoMakefile diff --git a/pfsagentd/pfsagentd-init/Makefile b/pfsagentd/pfsagentd-init/Makefile index e47578cc3..1251963f8 100644 --- a/pfsagentd/pfsagentd-init/Makefile +++ b/pfsagentd/pfsagentd-init/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/pfsagentd/pfsagentd-init +gosubdir := github.com/NVIDIA/proxyfs/pfsagentd/pfsagentd-init include ../../GoMakefile diff --git a/pfsagentd/pfsagentd-swift-auth-plugin/Makefile b/pfsagentd/pfsagentd-swift-auth-plugin/Makefile index c8ec40d10..2b2feefe7 100644 --- a/pfsagentd/pfsagentd-swift-auth-plugin/Makefile +++ b/pfsagentd/pfsagentd-swift-auth-plugin/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/pfsagentd/pfsagentd-swift-auth-plugin +gosubdir := github.com/NVIDIA/proxyfs/pfsagentd/pfsagentd-swift-auth-plugin include ../../GoMakefile diff --git a/pfsconfjson/Makefile b/pfsconfjson/Makefile index f81150fef..63e2cd571 100644 --- a/pfsconfjson/Makefile +++ b/pfsconfjson/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/pfsconfjson +gosubdir := github.com/NVIDIA/proxyfs/pfsconfjson include ../GoMakefile diff --git a/pfsconfjsonpacked/Makefile b/pfsconfjsonpacked/Makefile index a84882ca2..069317fbf 100644 --- a/pfsconfjsonpacked/Makefile +++ b/pfsconfjsonpacked/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/pfsconfjsonpacked +gosubdir := github.com/NVIDIA/proxyfs/pfsconfjsonpacked include ../GoMakefile diff --git a/pfsworkout/Makefile b/pfsworkout/Makefile index 9a9be24f1..eab2cae90 100644 --- a/pfsworkout/Makefile +++ b/pfsworkout/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/pfsworkout +gosubdir := github.com/NVIDIA/proxyfs/pfsworkout include ../GoMakefile diff --git a/platform/Makefile b/platform/Makefile index d053f9ae0..31637cc06 100644 --- a/platform/Makefile +++ b/platform/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/platform +gosubdir := github.com/NVIDIA/proxyfs/platform include ../GoMakefile diff --git a/proxyfsd/Makefile b/proxyfsd/Makefile index a5e91398c..850db1fa8 100644 --- a/proxyfsd/Makefile +++ b/proxyfsd/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/proxyfsd +gosubdir := github.com/NVIDIA/proxyfs/proxyfsd include ../GoMakefile diff --git a/proxyfsd/proxyfsd/Makefile b/proxyfsd/proxyfsd/Makefile index a1200f3a4..83d406207 100644 --- a/proxyfsd/proxyfsd/Makefile +++ b/proxyfsd/proxyfsd/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/proxyfsd/proxyfsd +gosubdir := github.com/NVIDIA/proxyfs/proxyfsd/proxyfsd include ../../GoMakefile diff --git a/ramswift/Makefile b/ramswift/Makefile index 4319b2cb7..fa8948bd5 100644 --- a/ramswift/Makefile +++ b/ramswift/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/ramswift +gosubdir := github.com/NVIDIA/proxyfs/ramswift include ../GoMakefile diff --git a/ramswift/ramswift/Makefile b/ramswift/ramswift/Makefile index e617a9e25..3c34d0687 100644 --- a/ramswift/ramswift/Makefile +++ b/ramswift/ramswift/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/ramswift/ramswift +gosubdir := github.com/NVIDIA/proxyfs/ramswift/ramswift include ../../GoMakefile diff --git a/retryrpc/Makefile b/retryrpc/Makefile index 69fd8bb6f..42dedddfe 100644 --- a/retryrpc/Makefile +++ b/retryrpc/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/retryrpc +gosubdir := github.com/NVIDIA/proxyfs/retryrpc include ../GoMakefile diff --git a/retryrpc/rpctest/Makefile b/retryrpc/rpctest/Makefile index 10472ef9a..85d4ff7ee 100644 --- a/retryrpc/rpctest/Makefile +++ b/retryrpc/rpctest/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/retryrpc/rpctest +gosubdir := github.com/NVIDIA/proxyfs/retryrpc/rpctest include ../../GoMakefile diff --git a/stats/Makefile b/stats/Makefile index 35caea243..5b4416209 100644 --- a/stats/Makefile +++ b/stats/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/stats +gosubdir := github.com/NVIDIA/proxyfs/stats include ../GoMakefile diff --git a/statslogger/Makefile b/statslogger/Makefile index cb2586dbd..dd3b90488 100644 --- a/statslogger/Makefile +++ b/statslogger/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/statslogger +gosubdir := github.com/NVIDIA/proxyfs/statslogger include ../GoMakefile diff --git a/swiftclient/Makefile b/swiftclient/Makefile index 725ecb28d..d92557039 100644 --- a/swiftclient/Makefile +++ b/swiftclient/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/swiftclient +gosubdir := github.com/NVIDIA/proxyfs/swiftclient include ../GoMakefile diff --git a/trackedlock/Makefile b/trackedlock/Makefile index d5c683823..d047b0e9e 100644 --- a/trackedlock/Makefile +++ b/trackedlock/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/trackedlock +gosubdir := github.com/NVIDIA/proxyfs/trackedlock include ../GoMakefile diff --git a/transitions/Makefile b/transitions/Makefile index a5e23279c..37a959a61 100644 --- a/transitions/Makefile +++ b/transitions/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/transitions +gosubdir := github.com/NVIDIA/proxyfs/transitions include ../GoMakefile diff --git a/utils/Makefile b/utils/Makefile index d7d7254b7..1af05292d 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -1,6 +1,6 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/utils +gosubdir := github.com/NVIDIA/proxyfs/utils include ../GoMakefile diff --git a/version/Makefile b/version/Makefile index 99075641d..20962736b 100644 --- a/version/Makefile +++ b/version/Makefile @@ -1,7 +1,7 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -gosubdir := github.com/swiftstack/ProxyFS/version +gosubdir := github.com/NVIDIA/proxyfs/version generatedfiles := \ proxyfs_version.go From e6b11b5f62f21984a3f5d31d3953089c5add0162 Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Mon, 8 Feb 2021 10:18:41 -0800 Subject: [PATCH 032/160] Migrated all .go files --- blunder/api.go | 2 +- blunder/api_test.go | 6 ++--- cleanproxyfs/main.go | 6 ++--- confgen/api_internal.go | 2 +- confgen/api_test.go | 2 +- confgen/confgen/main.go | 2 +- dlm/api.go | 2 +- dlm/config.go | 6 ++--- dlm/llm.go | 4 +-- dlm/llm_test.go | 10 +++---- emswift/emswiftpkg/api.go | 2 +- emswift/emswiftpkg/impl.go | 6 ++--- emswift/emswiftpkg/pkg_test.go | 4 +-- emswift/main.go | 4 +-- evtlog/api_test.go | 4 +-- evtlog/benchmark_test.go | 4 +-- evtlog/config.go | 8 +++--- evtlog/pfsevtlogd/main.go | 6 ++--- fs/api.go | 4 +-- fs/api_internal.go | 10 +++---- fs/api_test.go | 4 +-- fs/config.go | 14 +++++----- fs/metadata_stress_test.go | 4 +-- fs/resolve_path.go | 10 +++---- fs/resolve_path_test.go | 2 +- fs/setup_teardown_test.go | 6 ++--- fs/treewalk.go | 16 ++++++------ fs/utils.go | 2 +- fsworkout/main.go | 10 +++---- fuse/config.go | 10 +++---- fuse/dir.go | 8 +++--- fuse/file.go | 6 ++--- fuse/fuse.go | 6 ++--- fuse/symlink.go | 6 ++--- halter/api.go | 2 +- halter/api_test.go | 4 +-- halter/config.go | 6 ++--- headhunter/api.go | 2 +- headhunter/api_internal.go | 8 +++--- headhunter/api_test.go | 6 ++--- headhunter/checkpoint.go | 18 ++++++------- headhunter/config.go | 20 +++++++------- headhunter/sortedmap_helper.go | 12 ++++----- headhunter/stress_test.go | 6 ++--- httpserver/config.go | 20 +++++++------- httpserver/request_handler.go | 26 +++++++++---------- httpserver/setup_teardown_test.go | 6 ++--- imgr/globals.go | 4 +-- imgr/main.go | 2 +- inode/api.go | 6 ++--- inode/api_test.go | 4 +-- inode/benchmark_test.go | 2 +- inode/cache.go | 6 ++--- inode/coalesce_test.go | 2 +- inode/config.go | 20 +++++++------- inode/config_test.go | 2 +- inode/cron.go | 6 ++--- inode/cron_test.go | 2 +- inode/dir.go | 12 ++++----- inode/dir_stress_test.go | 4 +-- inode/file.go | 12 ++++----- inode/file_extent_test.go | 2 +- inode/file_flusher.go | 10 +++---- inode/gc_test.go | 2 +- inode/inode.go | 26 +++++++++---------- inode/locker.go | 2 +- inode/locker_test.go | 4 +-- inode/payload.go | 10 +++---- inode/setup_teardown_test.go | 6 ++--- inode/symlink.go | 4 +-- inode/validate_test.go | 4 +-- inode/volume.go | 6 ++--- inodeworkout/main.go | 8 +++--- jrpcfs/api.go | 6 ++--- jrpcfs/config.go | 12 ++++----- jrpcfs/filesystem.go | 12 ++++----- jrpcfs/io.go | 12 ++++----- jrpcfs/lease.go | 10 +++---- jrpcfs/lease_test.go | 2 +- jrpcfs/middleware.go | 10 +++---- jrpcfs/middleware_test.go | 16 ++++++------ jrpcfs/ping.go | 2 +- jrpcfs/retryrpc.go | 4 +-- liveness/config.go | 10 +++---- liveness/messages.go | 4 +-- liveness/polling.go | 6 ++--- liveness/states.go | 4 +-- logger/api.go | 2 +- logger/api_test.go | 4 +-- logger/config.go | 2 +- mkproxyfs/api.go | 16 ++++++------ mkproxyfs/mkproxyfs/main.go | 2 +- pfs-crash/main.go | 6 ++--- pfs-fsck/main.go | 10 +++---- pfs-jrpc/main.go | 4 +-- pfs-restart-test/main.go | 2 +- pfs-stress/main.go | 2 +- pfs-swift-load/main.go | 2 +- pfsagentConfig/pfsagentConfig/main.go | 2 +- pfsagentConfig/utils.go | 2 +- pfsagentd/file_inode.go | 6 ++--- pfsagentd/fission.go | 10 +++---- pfsagentd/globals.go | 18 ++++++------- pfsagentd/http_server.go | 6 ++--- pfsagentd/lease.go | 4 +-- pfsagentd/main.go | 2 +- pfsagentd/pfsagentd-init/main.go | 2 +- pfsagentd/pfsagentd-swift-auth-plugin/main.go | 2 +- pfsagentd/request.go | 6 ++--- pfsagentd/setup_teardown_test.go | 6 ++--- pfsagentd/swift_proxy_emulator_test.go | 2 +- pfsagentd/unit_test.go | 2 +- pfsconfjson/main.go | 4 +-- pfsconfjsonpacked/main.go | 4 +-- pfsworkout/main.go | 16 ++++++------ proxyfsd/daemon.go | 10 +++---- proxyfsd/daemon_test.go | 6 ++--- proxyfsd/proxyfsd/main.go | 2 +- ramswift/daemon.go | 8 +++--- ramswift/daemon_test.go | 2 +- ramswift/ramswift/main.go | 2 +- retryrpc/api.go | 4 +-- retryrpc/api_internal.go | 4 +-- retryrpc/client.go | 4 +-- retryrpc/retryrpc_test.go | 4 +-- retryrpc/rpctest/ping.go | 2 +- retryrpc/server.go | 4 +-- retryrpc/stress_test.go | 2 +- retryrpc/upcall_test.go | 2 +- stats/api_test.go | 4 +-- stats/config.go | 6 ++--- stats/sender.go | 2 +- statslogger/config.go | 12 ++++----- statslogger/config_test.go | 8 +++--- swiftclient/account.go | 8 +++--- swiftclient/api_test.go | 12 ++++----- swiftclient/config.go | 10 +++---- swiftclient/container.go | 8 +++--- swiftclient/http_status.go | 2 +- swiftclient/object.go | 12 ++++----- swiftclient/retry.go | 6 ++--- swiftclient/utils.go | 6 ++--- trackedlock/api.go | 2 +- trackedlock/api_internal.go | 4 +-- trackedlock/api_test.go | 4 +-- trackedlock/config.go | 6 ++--- transitions/api.go | 6 ++--- transitions/api_internal.go | 4 +-- transitions/api_test.go | 2 +- utils/api.go | 10 +++---- 150 files changed, 474 insertions(+), 474 deletions(-) diff --git a/blunder/api.go b/blunder/api.go index 5639861e0..cd78e441d 100644 --- a/blunder/api.go +++ b/blunder/api.go @@ -36,7 +36,7 @@ import ( "github.com/ansel1/merry" "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/logger" + "github.com/NVIDIA/proxyfs/logger" ) // Error constants to be used in the ProxyFS namespace. diff --git a/blunder/api_test.go b/blunder/api_test.go index 31874c6bd..9a1d05bf5 100644 --- a/blunder/api_test.go +++ b/blunder/api_test.go @@ -9,9 +9,9 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/transitions" ) var testConfMap conf.ConfMap diff --git a/cleanproxyfs/main.go b/cleanproxyfs/main.go index 1324c7377..fbcac8555 100644 --- a/cleanproxyfs/main.go +++ b/cleanproxyfs/main.go @@ -13,9 +13,9 @@ import ( "os" "strings" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/transitions" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/transitions" + "github.com/NVIDIA/proxyfs/utils" ) const ( diff --git a/confgen/api_internal.go b/confgen/api_internal.go index db629da28..2a635fa52 100644 --- a/confgen/api_internal.go +++ b/confgen/api_internal.go @@ -11,7 +11,7 @@ import ( "strconv" "strings" - "github.com/swiftstack/ProxyFS/conf" + "github.com/NVIDIA/proxyfs/conf" ) type envSettingsStruct struct { diff --git a/confgen/api_test.go b/confgen/api_test.go index b5b9f2353..dc5cd9fa5 100644 --- a/confgen/api_test.go +++ b/confgen/api_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/swiftstack/ProxyFS/conf" + "github.com/NVIDIA/proxyfs/conf" ) func getConfMap(t *testing.T, filename string) (confMap conf.ConfMap, err error) { diff --git a/confgen/confgen/main.go b/confgen/confgen/main.go index f971dffeb..a8f05ddf5 100644 --- a/confgen/confgen/main.go +++ b/confgen/confgen/main.go @@ -16,7 +16,7 @@ import ( "os" "strings" - "github.com/swiftstack/ProxyFS/confgen" + "github.com/NVIDIA/proxyfs/confgen" ) func usage() { diff --git a/dlm/api.go b/dlm/api.go index 61167c9b7..843a0a9c1 100644 --- a/dlm/api.go +++ b/dlm/api.go @@ -54,7 +54,7 @@ package dlm import ( "fmt" - "github.com/swiftstack/ProxyFS/trackedlock" + "github.com/NVIDIA/proxyfs/trackedlock" ) type NotifyReason uint32 diff --git a/dlm/config.go b/dlm/config.go index fbf0583cd..a89056300 100644 --- a/dlm/config.go +++ b/dlm/config.go @@ -6,9 +6,9 @@ package dlm // Configuration variables for DLM import ( - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/trackedlock" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/trackedlock" + "github.com/NVIDIA/proxyfs/transitions" ) type globalsStruct struct { diff --git a/dlm/llm.go b/dlm/llm.go index aa0b7e1b1..4a3090ad0 100644 --- a/dlm/llm.go +++ b/dlm/llm.go @@ -10,8 +10,8 @@ import ( "sync" "time" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/trackedlock" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/trackedlock" ) // This struct is used by LLM to track a lock. diff --git a/dlm/llm_test.go b/dlm/llm_test.go index 7ab6ed16f..7682f1700 100644 --- a/dlm/llm_test.go +++ b/dlm/llm_test.go @@ -13,11 +13,11 @@ import ( "github.com/stretchr/testify/assert" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/trackedlock" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/trackedlock" + "github.com/NVIDIA/proxyfs/transitions" ) // Test string for passing inode 1 diff --git a/emswift/emswiftpkg/api.go b/emswift/emswiftpkg/api.go index 080d66b3b..308cbd9da 100644 --- a/emswift/emswiftpkg/api.go +++ b/emswift/emswiftpkg/api.go @@ -4,7 +4,7 @@ package emswiftpkg import ( - "github.com/swiftstack/ProxyFS/conf" + "github.com/NVIDIA/proxyfs/conf" ) // Start is called to start serving the NoAuth Swift Proxy Port and, diff --git a/emswift/emswiftpkg/impl.go b/emswift/emswiftpkg/impl.go index 1473fb024..34296a622 100644 --- a/emswift/emswiftpkg/impl.go +++ b/emswift/emswiftpkg/impl.go @@ -17,10 +17,10 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/sortedmap" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/utils" ) type swiftAccountStruct struct { diff --git a/emswift/emswiftpkg/pkg_test.go b/emswift/emswiftpkg/pkg_test.go index 949b0fb56..31a3c896e 100644 --- a/emswift/emswiftpkg/pkg_test.go +++ b/emswift/emswiftpkg/pkg_test.go @@ -13,8 +13,8 @@ import ( "sync" "testing" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/utils" ) func TestAuthEmulation(t *testing.T) { diff --git a/emswift/main.go b/emswift/main.go index 94a14a148..4e9073845 100644 --- a/emswift/main.go +++ b/emswift/main.go @@ -10,8 +10,8 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/emswift/emswiftpkg" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/emswift/emswiftpkg" ) func main() { diff --git a/evtlog/api_test.go b/evtlog/api_test.go index fc60df978..95cb15111 100644 --- a/evtlog/api_test.go +++ b/evtlog/api_test.go @@ -6,8 +6,8 @@ package evtlog import ( "testing" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/transitions" ) func TestAPI(t *testing.T) { diff --git a/evtlog/benchmark_test.go b/evtlog/benchmark_test.go index 8c60d4c09..cd4476050 100644 --- a/evtlog/benchmark_test.go +++ b/evtlog/benchmark_test.go @@ -6,8 +6,8 @@ package evtlog import ( "testing" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/transitions" ) var ( diff --git a/evtlog/config.go b/evtlog/config.go index 52a394996..786a743d0 100644 --- a/evtlog/config.go +++ b/evtlog/config.go @@ -8,10 +8,10 @@ import ( "syscall" "time" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/trackedlock" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/trackedlock" + "github.com/NVIDIA/proxyfs/transitions" ) // #include diff --git a/evtlog/pfsevtlogd/main.go b/evtlog/pfsevtlogd/main.go index a35c9ed0a..a585da13e 100644 --- a/evtlog/pfsevtlogd/main.go +++ b/evtlog/pfsevtlogd/main.go @@ -13,9 +13,9 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/evtlog" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/evtlog" + "github.com/NVIDIA/proxyfs/transitions" ) func usage() { diff --git a/fs/api.go b/fs/api.go index 85f8aa125..350bf07cc 100644 --- a/fs/api.go +++ b/fs/api.go @@ -10,8 +10,8 @@ import "C" import ( "time" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/utils" ) // ReadRangeIn is the ReadPlan range requested diff --git a/fs/api_internal.go b/fs/api_internal.go index 6e67c3511..17a7c5fc7 100644 --- a/fs/api_internal.go +++ b/fs/api_internal.go @@ -14,11 +14,11 @@ import ( "syscall" "time" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/dlm" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/dlm" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/utils" ) // Shorthand for our internal API debug log id; global to the package diff --git a/fs/api_test.go b/fs/api_test.go index a4d030a88..62c944539 100644 --- a/fs/api_test.go +++ b/fs/api_test.go @@ -13,8 +13,8 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/inode" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/inode" ) // TODO: Enhance this to do a stat() as well and check number of files diff --git a/fs/config.go b/fs/config.go index 30d9f50ce..32af7807c 100644 --- a/fs/config.go +++ b/fs/config.go @@ -9,13 +9,13 @@ import ( "sync" "time" - "github.com/swiftstack/ProxyFS/bucketstats" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/headhunter" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/trackedlock" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/bucketstats" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/headhunter" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/trackedlock" + "github.com/NVIDIA/proxyfs/transitions" ) type inFlightFileInodeDataStruct struct { diff --git a/fs/metadata_stress_test.go b/fs/metadata_stress_test.go index ad22f8660..a4e9ee263 100644 --- a/fs/metadata_stress_test.go +++ b/fs/metadata_stress_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/utils" ) // diff --git a/fs/resolve_path.go b/fs/resolve_path.go index 8d038f879..0de667c08 100644 --- a/fs/resolve_path.go +++ b/fs/resolve_path.go @@ -7,11 +7,11 @@ import ( "fmt" "strings" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/dlm" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/dlm" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/utils" ) type resolvePathOption uint32 diff --git a/fs/resolve_path_test.go b/fs/resolve_path_test.go index c968337d6..5a6a521d2 100644 --- a/fs/resolve_path_test.go +++ b/fs/resolve_path_test.go @@ -6,7 +6,7 @@ package fs import ( "testing" - "github.com/swiftstack/ProxyFS/inode" + "github.com/NVIDIA/proxyfs/inode" ) func TestResolvePath(t *testing.T) { diff --git a/fs/setup_teardown_test.go b/fs/setup_teardown_test.go index 19976e24b..4ef4d7516 100644 --- a/fs/setup_teardown_test.go +++ b/fs/setup_teardown_test.go @@ -13,9 +13,9 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/ramswift" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/ramswift" + "github.com/NVIDIA/proxyfs/transitions" ) var ( diff --git a/fs/treewalk.go b/fs/treewalk.go index 9148fe20f..1faf29e49 100644 --- a/fs/treewalk.go +++ b/fs/treewalk.go @@ -14,14 +14,14 @@ import ( "sync" "time" - "github.com/swiftstack/sortedmap" - - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/dlm" - "github.com/swiftstack/ProxyFS/headhunter" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/swiftclient" + "github.com/NVIDIA/sortedmap" + + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/dlm" + "github.com/NVIDIA/proxyfs/headhunter" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/swiftclient" ) const ( diff --git a/fs/utils.go b/fs/utils.go index aadeb3e11..5df8460db 100644 --- a/fs/utils.go +++ b/fs/utils.go @@ -10,7 +10,7 @@ import ( "math/big" "time" - "github.com/swiftstack/ProxyFS/stats" + "github.com/NVIDIA/proxyfs/stats" ) func (tryLockBackoffContext *tryLockBackoffContextStruct) backoff() { diff --git a/fsworkout/main.go b/fsworkout/main.go index 1295ff7c9..7cf58d684 100644 --- a/fsworkout/main.go +++ b/fsworkout/main.go @@ -10,11 +10,11 @@ import ( "strconv" "time" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/fs" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/trackedlock" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/fs" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/trackedlock" + "github.com/NVIDIA/proxyfs/transitions" ) const ( diff --git a/fuse/config.go b/fuse/config.go index e5103db3d..5d9d84aff 100644 --- a/fuse/config.go +++ b/fuse/config.go @@ -15,11 +15,11 @@ import ( fuselib "bazil.org/fuse" fusefslib "bazil.org/fuse/fs" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/fs" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/trackedlock" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/fs" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/trackedlock" + "github.com/NVIDIA/proxyfs/transitions" ) const ( diff --git a/fuse/dir.go b/fuse/dir.go index 2af93486a..687e9ba3d 100644 --- a/fuse/dir.go +++ b/fuse/dir.go @@ -12,10 +12,10 @@ import ( fusefslib "bazil.org/fuse/fs" "golang.org/x/net/context" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/fs" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/logger" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/fs" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/logger" ) type Dir struct { diff --git a/fuse/file.go b/fuse/file.go index a4fc8a509..39ea8e793 100644 --- a/fuse/file.go +++ b/fuse/file.go @@ -12,9 +12,9 @@ import ( fuselib "bazil.org/fuse" "golang.org/x/net/context" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/fs" - "github.com/swiftstack/ProxyFS/inode" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/fs" + "github.com/NVIDIA/proxyfs/inode" ) type File struct { diff --git a/fuse/fuse.go b/fuse/fuse.go index 80f54a39e..a2293eb5b 100644 --- a/fuse/fuse.go +++ b/fuse/fuse.go @@ -11,9 +11,9 @@ import ( fusefslib "bazil.org/fuse/fs" "golang.org/x/net/context" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/fs" - "github.com/swiftstack/ProxyFS/inode" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/fs" + "github.com/NVIDIA/proxyfs/inode" ) type ProxyFUSE struct { diff --git a/fuse/symlink.go b/fuse/symlink.go index 6890e5eb8..cec57f442 100644 --- a/fuse/symlink.go +++ b/fuse/symlink.go @@ -11,9 +11,9 @@ import ( fuselib "bazil.org/fuse" "golang.org/x/net/context" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/fs" - "github.com/swiftstack/ProxyFS/inode" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/fs" + "github.com/NVIDIA/proxyfs/inode" ) type Symlink struct { diff --git a/halter/api.go b/halter/api.go index be70ab80d..8d64fcdca 100644 --- a/halter/api.go +++ b/halter/api.go @@ -8,7 +8,7 @@ import ( "os" "syscall" - "github.com/swiftstack/ProxyFS/evtlog" + "github.com/NVIDIA/proxyfs/evtlog" ) // Note 1: Following const block and HaltLabelStrings should be kept in sync diff --git a/halter/api_test.go b/halter/api_test.go index 0da377efb..1be723f3b 100644 --- a/halter/api_test.go +++ b/halter/api_test.go @@ -7,8 +7,8 @@ import ( "fmt" "testing" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/transitions" ) var ( diff --git a/halter/config.go b/halter/config.go index 462856e57..bf112b532 100644 --- a/halter/config.go +++ b/halter/config.go @@ -4,9 +4,9 @@ package halter import ( - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/trackedlock" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/trackedlock" + "github.com/NVIDIA/proxyfs/transitions" ) type globalsStruct struct { diff --git a/headhunter/api.go b/headhunter/api.go index 097795710..8fecdebc1 100644 --- a/headhunter/api.go +++ b/headhunter/api.go @@ -8,7 +8,7 @@ import ( "fmt" "time" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/sortedmap" ) type BPlusTreeType uint32 diff --git a/headhunter/api_internal.go b/headhunter/api_internal.go index 94a15f3e6..eb3d3804f 100644 --- a/headhunter/api_internal.go +++ b/headhunter/api_internal.go @@ -9,11 +9,11 @@ import ( "math/big" "time" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/sortedmap" - "github.com/swiftstack/ProxyFS/evtlog" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/swiftclient" + "github.com/NVIDIA/proxyfs/evtlog" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/swiftclient" ) func (volume *volumeStruct) RegisterForEvents(listener VolumeEventListener) { diff --git a/headhunter/api_test.go b/headhunter/api_test.go index acc051859..2557ef9a4 100644 --- a/headhunter/api_test.go +++ b/headhunter/api_test.go @@ -10,9 +10,9 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/ramswift" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/ramswift" + "github.com/NVIDIA/proxyfs/transitions" ) func inodeRecPutGet(t *testing.T, volume VolumeHandle, key uint64, value []byte) { diff --git a/headhunter/checkpoint.go b/headhunter/checkpoint.go index 5bd58451c..de33bfb5d 100644 --- a/headhunter/checkpoint.go +++ b/headhunter/checkpoint.go @@ -19,15 +19,15 @@ import ( etcd "go.etcd.io/etcd/clientv3" - "github.com/swiftstack/cstruct" - "github.com/swiftstack/sortedmap" - - "github.com/swiftstack/ProxyFS/evtlog" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/platform" - "github.com/swiftstack/ProxyFS/stats" - "github.com/swiftstack/ProxyFS/swiftclient" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/cstruct" + "github.com/NVIDIA/sortedmap" + + "github.com/NVIDIA/proxyfs/evtlog" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/platform" + "github.com/NVIDIA/proxyfs/stats" + "github.com/NVIDIA/proxyfs/swiftclient" + "github.com/NVIDIA/proxyfs/utils" ) var ( diff --git a/headhunter/config.go b/headhunter/config.go index e8c2c1794..cd684bbca 100644 --- a/headhunter/config.go +++ b/headhunter/config.go @@ -14,16 +14,16 @@ import ( etcd "go.etcd.io/etcd/clientv3" "go.etcd.io/etcd/pkg/transport" - "github.com/swiftstack/cstruct" - "github.com/swiftstack/sortedmap" - - "github.com/swiftstack/ProxyFS/bucketstats" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/etcdclient" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/swiftclient" - "github.com/swiftstack/ProxyFS/trackedlock" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/cstruct" + "github.com/NVIDIA/sortedmap" + + "github.com/NVIDIA/proxyfs/bucketstats" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/etcdclient" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/swiftclient" + "github.com/NVIDIA/proxyfs/trackedlock" + "github.com/NVIDIA/proxyfs/transitions" ) const ( diff --git a/headhunter/sortedmap_helper.go b/headhunter/sortedmap_helper.go index 73c3aa53b..7b447afc3 100644 --- a/headhunter/sortedmap_helper.go +++ b/headhunter/sortedmap_helper.go @@ -6,13 +6,13 @@ package headhunter import ( "fmt" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/sortedmap" - "github.com/swiftstack/ProxyFS/evtlog" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/stats" - "github.com/swiftstack/ProxyFS/swiftclient" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/evtlog" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/stats" + "github.com/NVIDIA/proxyfs/swiftclient" + "github.com/NVIDIA/proxyfs/utils" ) func (bPlusTreeWrapper *bPlusTreeWrapperStruct) DumpKey(key sortedmap.Key) (keyAsString string, err error) { diff --git a/headhunter/stress_test.go b/headhunter/stress_test.go index 2731541bc..76ebe3f67 100644 --- a/headhunter/stress_test.go +++ b/headhunter/stress_test.go @@ -13,9 +13,9 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/ramswift" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/ramswift" + "github.com/NVIDIA/proxyfs/transitions" ) const ( diff --git a/httpserver/config.go b/httpserver/config.go index 69caaff4a..0c026f5f1 100644 --- a/httpserver/config.go +++ b/httpserver/config.go @@ -10,19 +10,19 @@ import ( "sync" "time" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/sortedmap" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/fs" - "github.com/swiftstack/ProxyFS/headhunter" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/fs" + "github.com/NVIDIA/proxyfs/headhunter" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/transitions" // Force importing of the following next "top-most" packages - _ "github.com/swiftstack/ProxyFS/fuse" - _ "github.com/swiftstack/ProxyFS/jrpcfs" - _ "github.com/swiftstack/ProxyFS/statslogger" - "github.com/swiftstack/ProxyFS/trackedlock" + _ "github.com/NVIDIA/proxyfs/fuse" + _ "github.com/NVIDIA/proxyfs/jrpcfs" + _ "github.com/NVIDIA/proxyfs/statslogger" + "github.com/NVIDIA/proxyfs/trackedlock" ) type ExtentMapElementStruct struct { diff --git a/httpserver/request_handler.go b/httpserver/request_handler.go index 813a27845..b8eed5c94 100644 --- a/httpserver/request_handler.go +++ b/httpserver/request_handler.go @@ -19,19 +19,19 @@ import ( "strings" "time" - "github.com/swiftstack/sortedmap" - - "github.com/swiftstack/ProxyFS/bucketstats" - "github.com/swiftstack/ProxyFS/fs" - "github.com/swiftstack/ProxyFS/halter" - "github.com/swiftstack/ProxyFS/headhunter" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/jrpcfs" - "github.com/swiftstack/ProxyFS/liveness" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/stats" - "github.com/swiftstack/ProxyFS/utils" - "github.com/swiftstack/ProxyFS/version" + "github.com/NVIDIA/sortedmap" + + "github.com/NVIDIA/proxyfs/bucketstats" + "github.com/NVIDIA/proxyfs/fs" + "github.com/NVIDIA/proxyfs/halter" + "github.com/NVIDIA/proxyfs/headhunter" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/jrpcfs" + "github.com/NVIDIA/proxyfs/liveness" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/stats" + "github.com/NVIDIA/proxyfs/utils" + "github.com/NVIDIA/proxyfs/version" ) type httpRequestHandler struct{} diff --git a/httpserver/setup_teardown_test.go b/httpserver/setup_teardown_test.go index 26f9be836..5c138c419 100644 --- a/httpserver/setup_teardown_test.go +++ b/httpserver/setup_teardown_test.go @@ -10,9 +10,9 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/ramswift" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/ramswift" + "github.com/NVIDIA/proxyfs/transitions" ) var ( diff --git a/imgr/globals.go b/imgr/globals.go index 2f7955d82..9e7623f9f 100644 --- a/imgr/globals.go +++ b/imgr/globals.go @@ -9,8 +9,8 @@ import ( "sync" "time" - "github.com/swiftstack/ProxyFS/bucketstats" - "github.com/swiftstack/ProxyFS/conf" + "github.com/NVIDIA/proxyfs/bucketstats" + "github.com/NVIDIA/proxyfs/conf" ) type configStruct struct { diff --git a/imgr/main.go b/imgr/main.go index 9a86ffee9..25ebc728a 100644 --- a/imgr/main.go +++ b/imgr/main.go @@ -10,7 +10,7 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/conf" + "github.com/NVIDIA/proxyfs/conf" ) func main() { diff --git a/inode/api.go b/inode/api.go index 832b763bb..0bd698669 100644 --- a/inode/api.go +++ b/inode/api.go @@ -10,10 +10,10 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/sortedmap" - "github.com/swiftstack/ProxyFS/dlm" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/dlm" + "github.com/NVIDIA/proxyfs/utils" ) type InodeNumber uint64 diff --git a/inode/api_test.go b/inode/api_test.go index d47a46559..00c17a435 100644 --- a/inode/api_test.go +++ b/inode/api_test.go @@ -11,8 +11,8 @@ import ( "time" "github.com/stretchr/testify/assert" - "github.com/swiftstack/ProxyFS/swiftclient" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/swiftclient" + "github.com/NVIDIA/proxyfs/utils" ) const durationToDelayOrSkew = "100ms" diff --git a/inode/benchmark_test.go b/inode/benchmark_test.go index 312599a97..262f602ee 100644 --- a/inode/benchmark_test.go +++ b/inode/benchmark_test.go @@ -7,7 +7,7 @@ import ( "strconv" "testing" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/utils" ) func writeBenchmarkHelper(b *testing.B, byteSize uint64) { diff --git a/inode/cache.go b/inode/cache.go index 3a44f51d8..53a0a216f 100644 --- a/inode/cache.go +++ b/inode/cache.go @@ -7,9 +7,9 @@ import ( "fmt" "time" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/platform" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/platform" ) func adoptVolumeGroupReadCacheParameters(confMap conf.ConfMap) (err error) { diff --git a/inode/coalesce_test.go b/inode/coalesce_test.go index 99dad38d1..57b5eabf9 100644 --- a/inode/coalesce_test.go +++ b/inode/coalesce_test.go @@ -8,7 +8,7 @@ import ( "time" "github.com/stretchr/testify/assert" - "github.com/swiftstack/ProxyFS/blunder" + "github.com/NVIDIA/proxyfs/blunder" ) // NB: test setup and such is in api_test.go (look for TestMain function) diff --git a/inode/config.go b/inode/config.go index 79c1837c1..1536b5e3d 100644 --- a/inode/config.go +++ b/inode/config.go @@ -9,16 +9,16 @@ import ( "time" "unsafe" - "github.com/swiftstack/cstruct" - "github.com/swiftstack/sortedmap" - - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/headhunter" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/swiftclient" - "github.com/swiftstack/ProxyFS/trackedlock" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/cstruct" + "github.com/NVIDIA/sortedmap" + + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/headhunter" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/swiftclient" + "github.com/NVIDIA/proxyfs/trackedlock" + "github.com/NVIDIA/proxyfs/transitions" ) type readCacheKeyStruct struct { diff --git a/inode/config_test.go b/inode/config_test.go index b1e64d484..c10a6d9c8 100644 --- a/inode/config_test.go +++ b/inode/config_test.go @@ -6,7 +6,7 @@ package inode import ( "testing" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/transitions" "github.com/stretchr/testify/assert" ) diff --git a/inode/cron.go b/inode/cron.go index aa32a816d..0ce548466 100644 --- a/inode/cron.go +++ b/inode/cron.go @@ -10,9 +10,9 @@ import ( "sync" "time" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/headhunter" - "github.com/swiftstack/ProxyFS/logger" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/headhunter" + "github.com/NVIDIA/proxyfs/logger" ) type snapShotScheduleStruct struct { diff --git a/inode/cron_test.go b/inode/cron_test.go index d5c142fa0..f4921e83d 100644 --- a/inode/cron_test.go +++ b/inode/cron_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/swiftstack/ProxyFS/conf" + "github.com/NVIDIA/proxyfs/conf" ) func TestLoadSnapShotPolicy(t *testing.T) { diff --git a/inode/dir.go b/inode/dir.go index a4ccf7d7f..ab6668553 100644 --- a/inode/dir.go +++ b/inode/dir.go @@ -7,13 +7,13 @@ import ( "fmt" "time" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/sortedmap" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/headhunter" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/stats" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/headhunter" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/stats" + "github.com/NVIDIA/proxyfs/utils" ) func (vS *volumeStruct) createRootOrSubDir(filePerm InodeMode, userID InodeUserID, groupID InodeGroupID, isRootDir bool) (dirInodeNumber InodeNumber, err error) { diff --git a/inode/dir_stress_test.go b/inode/dir_stress_test.go index a81e0d90a..a92af896c 100644 --- a/inode/dir_stress_test.go +++ b/inode/dir_stress_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/swiftstack/ProxyFS/headhunter" - "github.com/swiftstack/ProxyFS/trackedlock" + "github.com/NVIDIA/proxyfs/headhunter" + "github.com/NVIDIA/proxyfs/trackedlock" ) const ( diff --git a/inode/file.go b/inode/file.go index d7ea024fe..ac77bbef3 100644 --- a/inode/file.go +++ b/inode/file.go @@ -8,13 +8,13 @@ import ( "strconv" "time" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/sortedmap" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/headhunter" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/stats" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/headhunter" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/stats" + "github.com/NVIDIA/proxyfs/utils" ) type fileExtentStruct struct { diff --git a/inode/file_extent_test.go b/inode/file_extent_test.go index 95421ca7f..1882422a9 100644 --- a/inode/file_extent_test.go +++ b/inode/file_extent_test.go @@ -11,7 +11,7 @@ import ( mathRand "math/rand" "testing" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/sortedmap" ) const ( diff --git a/inode/file_flusher.go b/inode/file_flusher.go index f68bfa9af..779cfd804 100644 --- a/inode/file_flusher.go +++ b/inode/file_flusher.go @@ -6,11 +6,11 @@ package inode import ( "fmt" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/stats" - "github.com/swiftstack/ProxyFS/swiftclient" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/stats" + "github.com/NVIDIA/proxyfs/swiftclient" + "github.com/NVIDIA/proxyfs/utils" ) func openLogSegmentLRUInsertWhileLocked(inFlightLogSegment *inFlightLogSegmentStruct) { diff --git a/inode/gc_test.go b/inode/gc_test.go index 28f1c9653..8cc68afc8 100644 --- a/inode/gc_test.go +++ b/inode/gc_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/swiftstack/ProxyFS/swiftclient" + "github.com/NVIDIA/proxyfs/swiftclient" ) type testObjectLocationStruct struct { diff --git a/inode/inode.go b/inode/inode.go index ede7fcd66..25b64c2d5 100644 --- a/inode/inode.go +++ b/inode/inode.go @@ -13,19 +13,19 @@ import ( "time" "github.com/ansel1/merry" - "github.com/swiftstack/cstruct" - "github.com/swiftstack/sortedmap" - - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/dlm" - "github.com/swiftstack/ProxyFS/evtlog" - "github.com/swiftstack/ProxyFS/halter" - "github.com/swiftstack/ProxyFS/headhunter" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/stats" - "github.com/swiftstack/ProxyFS/swiftclient" - "github.com/swiftstack/ProxyFS/trackedlock" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/cstruct" + "github.com/NVIDIA/sortedmap" + + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/dlm" + "github.com/NVIDIA/proxyfs/evtlog" + "github.com/NVIDIA/proxyfs/halter" + "github.com/NVIDIA/proxyfs/headhunter" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/stats" + "github.com/NVIDIA/proxyfs/swiftclient" + "github.com/NVIDIA/proxyfs/trackedlock" + "github.com/NVIDIA/proxyfs/utils" ) // Shorthand for inode internal API debug log id; global to the package diff --git a/inode/locker.go b/inode/locker.go index 5e665e0c1..6f32d1577 100644 --- a/inode/locker.go +++ b/inode/locker.go @@ -13,7 +13,7 @@ package inode import ( "fmt" - "github.com/swiftstack/ProxyFS/dlm" + "github.com/NVIDIA/proxyfs/dlm" ) // MakeLockID creates the ID of an inode used in volume diff --git a/inode/locker_test.go b/inode/locker_test.go index 7776f2834..17adc4687 100644 --- a/inode/locker_test.go +++ b/inode/locker_test.go @@ -6,8 +6,8 @@ package inode import ( "testing" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/dlm" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/dlm" ) func TestLockerStuff(t *testing.T) { diff --git a/inode/payload.go b/inode/payload.go index dedb9603c..48331c73d 100644 --- a/inode/payload.go +++ b/inode/payload.go @@ -7,12 +7,12 @@ import ( "bytes" "fmt" - "github.com/swiftstack/ProxyFS/evtlog" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/stats" + "github.com/NVIDIA/proxyfs/evtlog" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/stats" - "github.com/swiftstack/cstruct" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/cstruct" + "github.com/NVIDIA/sortedmap" ) // For DirType inodes, our payload tree-map is from basenames to inode numbers. diff --git a/inode/setup_teardown_test.go b/inode/setup_teardown_test.go index 6348f78ef..d2c307f42 100644 --- a/inode/setup_teardown_test.go +++ b/inode/setup_teardown_test.go @@ -13,9 +13,9 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/ramswift" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/ramswift" + "github.com/NVIDIA/proxyfs/transitions" ) var ( diff --git a/inode/symlink.go b/inode/symlink.go index 649fbd8a2..d5abb19f0 100644 --- a/inode/symlink.go +++ b/inode/symlink.go @@ -6,8 +6,8 @@ package inode import ( "fmt" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/stats" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/stats" ) func (vS *volumeStruct) CreateSymlink(target string, filePerm InodeMode, userID InodeUserID, groupID InodeGroupID) (symlinkInodeNumber InodeNumber, err error) { diff --git a/inode/validate_test.go b/inode/validate_test.go index 922eb24b1..1aba9f325 100644 --- a/inode/validate_test.go +++ b/inode/validate_test.go @@ -7,8 +7,8 @@ import ( "strings" "testing" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/swiftclient" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/swiftclient" ) // Helper to fetch a volume handle and create a file for a test. Return the diff --git a/inode/volume.go b/inode/volume.go index 17e916bb7..3e8b3563b 100644 --- a/inode/volume.go +++ b/inode/volume.go @@ -6,9 +6,9 @@ package inode import ( "fmt" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/stats" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/stats" + "github.com/NVIDIA/sortedmap" ) func (vS *volumeStruct) GetFSID() (fsid uint64) { diff --git a/inodeworkout/main.go b/inodeworkout/main.go index 040f08584..1a1e9d22c 100644 --- a/inodeworkout/main.go +++ b/inodeworkout/main.go @@ -10,10 +10,10 @@ import ( "strconv" "time" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/trackedlock" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/trackedlock" + "github.com/NVIDIA/proxyfs/transitions" ) const ( diff --git a/jrpcfs/api.go b/jrpcfs/api.go index 8696a0150..5b31debfa 100644 --- a/jrpcfs/api.go +++ b/jrpcfs/api.go @@ -150,9 +150,9 @@ package jrpcfs import ( - "github.com/swiftstack/ProxyFS/fs" - "github.com/swiftstack/ProxyFS/headhunter" - "github.com/swiftstack/ProxyFS/inode" + "github.com/NVIDIA/proxyfs/fs" + "github.com/NVIDIA/proxyfs/headhunter" + "github.com/NVIDIA/proxyfs/inode" ) // The first section of this file defines the structs used by protocols like Samba. diff --git a/jrpcfs/config.go b/jrpcfs/config.go index 51cb46ee7..31e96e341 100644 --- a/jrpcfs/config.go +++ b/jrpcfs/config.go @@ -10,12 +10,12 @@ import ( "sync" "time" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/fs" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/retryrpc" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/fs" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/retryrpc" + "github.com/NVIDIA/proxyfs/transitions" ) type leaseRequestOperationStruct struct { diff --git a/jrpcfs/filesystem.go b/jrpcfs/filesystem.go index 90147a737..ea6ab978c 100644 --- a/jrpcfs/filesystem.go +++ b/jrpcfs/filesystem.go @@ -16,12 +16,12 @@ import ( "sync" "time" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/fs" - "github.com/swiftstack/ProxyFS/headhunter" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/fs" + "github.com/NVIDIA/proxyfs/headhunter" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/utils" ) // RPC server handle diff --git a/jrpcfs/io.go b/jrpcfs/io.go index a4a0cefbf..55a17bce5 100644 --- a/jrpcfs/io.go +++ b/jrpcfs/io.go @@ -12,12 +12,12 @@ import ( "time" "unsafe" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/fs" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/stats" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/fs" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/stats" + "github.com/NVIDIA/proxyfs/utils" ) // Server handle, used to track io-related ops diff --git a/jrpcfs/lease.go b/jrpcfs/lease.go index 33fa956fc..11acf3ac5 100644 --- a/jrpcfs/lease.go +++ b/jrpcfs/lease.go @@ -11,11 +11,11 @@ import ( "sync" "time" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/evtlog" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/evtlog" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/sortedmap" ) // RpcLease is called to either request a Shared|Exclusive Lease or to diff --git a/jrpcfs/lease_test.go b/jrpcfs/lease_test.go index 6d8464cd2..f0517c1de 100644 --- a/jrpcfs/lease_test.go +++ b/jrpcfs/lease_test.go @@ -13,7 +13,7 @@ import ( "testing" "time" - "github.com/swiftstack/ProxyFS/retryrpc" + "github.com/NVIDIA/proxyfs/retryrpc" ) const ( diff --git a/jrpcfs/middleware.go b/jrpcfs/middleware.go index fc56f3c4a..1fb422f68 100644 --- a/jrpcfs/middleware.go +++ b/jrpcfs/middleware.go @@ -6,11 +6,11 @@ package jrpcfs import ( "fmt" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/fs" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/fs" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/utils" ) // JSON RPC Server on top of the FS package. diff --git a/jrpcfs/middleware_test.go b/jrpcfs/middleware_test.go index 04f995ec9..b699c287f 100644 --- a/jrpcfs/middleware_test.go +++ b/jrpcfs/middleware_test.go @@ -15,14 +15,14 @@ import ( "golang.org/x/sys/unix" "github.com/stretchr/testify/assert" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/fs" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/ramswift" - "github.com/swiftstack/ProxyFS/swiftclient" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/fs" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/ramswift" + "github.com/NVIDIA/proxyfs/swiftclient" + "github.com/NVIDIA/proxyfs/transitions" ) // Shorthand for our testing debug log id; global to the package diff --git a/jrpcfs/ping.go b/jrpcfs/ping.go index 583dffcaf..9a6ce2688 100644 --- a/jrpcfs/ping.go +++ b/jrpcfs/ping.go @@ -7,7 +7,7 @@ package jrpcfs import ( "fmt" - "github.com/swiftstack/ProxyFS/logger" + "github.com/NVIDIA/proxyfs/logger" ) func (s *Server) RpcPing(in *PingReq, reply *PingReply) (err error) { diff --git a/jrpcfs/retryrpc.go b/jrpcfs/retryrpc.go index e6593ad76..850b43b33 100644 --- a/jrpcfs/retryrpc.go +++ b/jrpcfs/retryrpc.go @@ -6,8 +6,8 @@ package jrpcfs import ( "time" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/retryrpc" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/retryrpc" ) func retryRPCServerUp(jserver *Server, publicIPAddr string, retryRPCPort uint16, diff --git a/liveness/config.go b/liveness/config.go index 58b77aaa4..f85d060bb 100644 --- a/liveness/config.go +++ b/liveness/config.go @@ -13,11 +13,11 @@ import ( "sync" "time" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/trackedlock" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/trackedlock" + "github.com/NVIDIA/proxyfs/transitions" ) const ( diff --git a/liveness/messages.go b/liveness/messages.go index 023c3c123..3337b2c04 100644 --- a/liveness/messages.go +++ b/liveness/messages.go @@ -12,8 +12,8 @@ import ( "reflect" "time" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/logger" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/logger" ) // Each UDP Packet Header is made up of (also in LittleEndian byte order): diff --git a/liveness/polling.go b/liveness/polling.go index 603f0b508..4ce6e85af 100644 --- a/liveness/polling.go +++ b/liveness/polling.go @@ -19,9 +19,9 @@ import ( "regexp" "time" - "github.com/swiftstack/ProxyFS/jrpcfs" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/jrpcfs" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/utils" ) type pingReqStruct struct { diff --git a/liveness/states.go b/liveness/states.go index c17281a4b..3997388cb 100644 --- a/liveness/states.go +++ b/liveness/states.go @@ -10,8 +10,8 @@ import ( "runtime" "time" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/logger" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/logger" ) func stateMachine() { diff --git a/logger/api.go b/logger/api.go index 179122e90..86753031d 100644 --- a/logger/api.go +++ b/logger/api.go @@ -26,7 +26,7 @@ import ( log "github.com/sirupsen/logrus" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/utils" ) type Level int diff --git a/logger/api_test.go b/logger/api_test.go index 814aabfbe..64ff7d6de 100644 --- a/logger/api_test.go +++ b/logger/api_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/utils" ) func testNestedFunc() { diff --git a/logger/config.go b/logger/config.go index a6bf0836d..e5c26d959 100644 --- a/logger/config.go +++ b/logger/config.go @@ -12,7 +12,7 @@ import ( log "github.com/sirupsen/logrus" - "github.com/swiftstack/ProxyFS/conf" + "github.com/NVIDIA/proxyfs/conf" ) // RFC3339 format with microsecond precision diff --git a/mkproxyfs/api.go b/mkproxyfs/api.go index 0c6901d1d..c2b92c88c 100644 --- a/mkproxyfs/api.go +++ b/mkproxyfs/api.go @@ -14,14 +14,14 @@ import ( etcd "go.etcd.io/etcd/clientv3" "go.etcd.io/etcd/pkg/transport" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/etcdclient" - "github.com/swiftstack/ProxyFS/headhunter" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/swiftclient" - "github.com/swiftstack/ProxyFS/transitions" - "github.com/swiftstack/ProxyFS/version" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/etcdclient" + "github.com/NVIDIA/proxyfs/headhunter" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/swiftclient" + "github.com/NVIDIA/proxyfs/transitions" + "github.com/NVIDIA/proxyfs/version" ) type Mode int diff --git a/mkproxyfs/mkproxyfs/main.go b/mkproxyfs/mkproxyfs/main.go index c9078f6ad..5d4610ac9 100644 --- a/mkproxyfs/mkproxyfs/main.go +++ b/mkproxyfs/mkproxyfs/main.go @@ -9,7 +9,7 @@ import ( "fmt" "os" - "github.com/swiftstack/ProxyFS/mkproxyfs" + "github.com/NVIDIA/proxyfs/mkproxyfs" ) func usage() { diff --git a/pfs-crash/main.go b/pfs-crash/main.go index 7968af1e9..e39541129 100644 --- a/pfs-crash/main.go +++ b/pfs-crash/main.go @@ -26,9 +26,9 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/httpserver" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/httpserver" + "github.com/NVIDIA/proxyfs/transitions" ) const ( diff --git a/pfs-fsck/main.go b/pfs-fsck/main.go index 8945383da..e903cf5f1 100644 --- a/pfs-fsck/main.go +++ b/pfs-fsck/main.go @@ -19,12 +19,12 @@ import ( etcd "go.etcd.io/etcd/clientv3" "go.etcd.io/etcd/pkg/transport" - "github.com/swiftstack/cstruct" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/cstruct" + "github.com/NVIDIA/sortedmap" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/etcdclient" - "github.com/swiftstack/ProxyFS/headhunter" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/etcdclient" + "github.com/NVIDIA/proxyfs/headhunter" ) const ( diff --git a/pfs-jrpc/main.go b/pfs-jrpc/main.go index 53b820407..2bf7d548b 100644 --- a/pfs-jrpc/main.go +++ b/pfs-jrpc/main.go @@ -13,8 +13,8 @@ import ( "os" "strings" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/jrpcfs" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/jrpcfs" ) type jrpcRequestStruct struct { diff --git a/pfs-restart-test/main.go b/pfs-restart-test/main.go index 53c9ee633..befd6c083 100644 --- a/pfs-restart-test/main.go +++ b/pfs-restart-test/main.go @@ -16,7 +16,7 @@ import ( "strconv" "time" - "github.com/swiftstack/ProxyFS/conf" + "github.com/NVIDIA/proxyfs/conf" "golang.org/x/sys/unix" ) diff --git a/pfs-stress/main.go b/pfs-stress/main.go index 376783447..08b7d5669 100644 --- a/pfs-stress/main.go +++ b/pfs-stress/main.go @@ -16,7 +16,7 @@ import ( "sync/atomic" "time" - "github.com/swiftstack/ProxyFS/conf" + "github.com/NVIDIA/proxyfs/conf" ) var ( diff --git a/pfs-swift-load/main.go b/pfs-swift-load/main.go index 8bf9d09ef..a18801997 100644 --- a/pfs-swift-load/main.go +++ b/pfs-swift-load/main.go @@ -15,7 +15,7 @@ import ( "sync" "time" - "github.com/swiftstack/ProxyFS/conf" + "github.com/NVIDIA/proxyfs/conf" ) const ( diff --git a/pfsagentConfig/pfsagentConfig/main.go b/pfsagentConfig/pfsagentConfig/main.go index ef0fe7ce8..a20373814 100644 --- a/pfsagentConfig/pfsagentConfig/main.go +++ b/pfsagentConfig/pfsagentConfig/main.go @@ -7,7 +7,7 @@ import ( "fmt" "os" - pfsagentConfig "github.com/swiftstack/ProxyFS/pfsagentConfig" + pfsagentConfig "github.com/NVIDIA/proxyfs/pfsagentConfig" ) const ( diff --git a/pfsagentConfig/utils.go b/pfsagentConfig/utils.go index 376c33e02..3fe8ffa89 100644 --- a/pfsagentConfig/utils.go +++ b/pfsagentConfig/utils.go @@ -11,7 +11,7 @@ import ( "os" "os/user" - "github.com/swiftstack/ProxyFS/conf" + "github.com/NVIDIA/proxyfs/conf" ) const ( diff --git a/pfsagentd/file_inode.go b/pfsagentd/file_inode.go index 296ab0863..004ae4bcb 100644 --- a/pfsagentd/file_inode.go +++ b/pfsagentd/file_inode.go @@ -14,10 +14,10 @@ import ( "sync/atomic" "time" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/sortedmap" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/jrpcfs" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/jrpcfs" ) func (fileInode *fileInodeStruct) doFlushIfNecessary() { diff --git a/pfsagentd/fission.go b/pfsagentd/fission.go index c98118c96..14302789f 100644 --- a/pfsagentd/fission.go +++ b/pfsagentd/fission.go @@ -12,12 +12,12 @@ import ( "syscall" "time" - "github.com/swiftstack/fission" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/fission" + "github.com/NVIDIA/sortedmap" - "github.com/swiftstack/ProxyFS/fs" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/jrpcfs" + "github.com/NVIDIA/proxyfs/fs" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/jrpcfs" ) const ( diff --git a/pfsagentd/globals.go b/pfsagentd/globals.go index 4cd45af1d..38995ceef 100644 --- a/pfsagentd/globals.go +++ b/pfsagentd/globals.go @@ -17,15 +17,15 @@ import ( "bazil.org/fuse" - "github.com/swiftstack/fission" - "github.com/swiftstack/sortedmap" - - "github.com/swiftstack/ProxyFS/bucketstats" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/jrpcfs" - "github.com/swiftstack/ProxyFS/retryrpc" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/fission" + "github.com/NVIDIA/sortedmap" + + "github.com/NVIDIA/proxyfs/bucketstats" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/jrpcfs" + "github.com/NVIDIA/proxyfs/retryrpc" + "github.com/NVIDIA/proxyfs/utils" ) type configStruct struct { diff --git a/pfsagentd/http_server.go b/pfsagentd/http_server.go index 486d54b13..faa8833dd 100644 --- a/pfsagentd/http_server.go +++ b/pfsagentd/http_server.go @@ -19,10 +19,10 @@ import ( "strings" "sync/atomic" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/sortedmap" - "github.com/swiftstack/ProxyFS/bucketstats" - "github.com/swiftstack/ProxyFS/version" + "github.com/NVIDIA/proxyfs/bucketstats" + "github.com/NVIDIA/proxyfs/version" ) type leaseReportStruct struct { diff --git a/pfsagentd/lease.go b/pfsagentd/lease.go index 2d0f3d3f7..359dc77b3 100644 --- a/pfsagentd/lease.go +++ b/pfsagentd/lease.go @@ -8,8 +8,8 @@ import ( "encoding/json" "time" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/jrpcfs" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/jrpcfs" ) func (dummy *globalsStruct) Interrupt(rpcInterruptBuf []byte) { diff --git a/pfsagentd/main.go b/pfsagentd/main.go index 0378809dd..e0f9eb753 100644 --- a/pfsagentd/main.go +++ b/pfsagentd/main.go @@ -10,7 +10,7 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/conf" + "github.com/NVIDIA/proxyfs/conf" ) func main() { diff --git a/pfsagentd/pfsagentd-init/main.go b/pfsagentd/pfsagentd-init/main.go index db9ae62b9..c251317a5 100644 --- a/pfsagentd/pfsagentd-init/main.go +++ b/pfsagentd/pfsagentd-init/main.go @@ -18,7 +18,7 @@ import ( "sync" "time" - "github.com/swiftstack/ProxyFS/conf" + "github.com/NVIDIA/proxyfs/conf" "golang.org/x/sys/unix" ) diff --git a/pfsagentd/pfsagentd-swift-auth-plugin/main.go b/pfsagentd/pfsagentd-swift-auth-plugin/main.go index 1d04c9cb9..7e9037b5e 100644 --- a/pfsagentd/pfsagentd-swift-auth-plugin/main.go +++ b/pfsagentd/pfsagentd-swift-auth-plugin/main.go @@ -11,7 +11,7 @@ import ( "os" "strings" - "github.com/swiftstack/ProxyFS/version" + "github.com/NVIDIA/proxyfs/version" ) type authInStruct struct { diff --git a/pfsagentd/request.go b/pfsagentd/request.go index 5981a88d4..8631dddc6 100644 --- a/pfsagentd/request.go +++ b/pfsagentd/request.go @@ -17,9 +17,9 @@ import ( "sync/atomic" "time" - "github.com/swiftstack/ProxyFS/jrpcfs" - "github.com/swiftstack/ProxyFS/retryrpc" - "github.com/swiftstack/ProxyFS/version" + "github.com/NVIDIA/proxyfs/jrpcfs" + "github.com/NVIDIA/proxyfs/retryrpc" + "github.com/NVIDIA/proxyfs/version" ) const ( diff --git a/pfsagentd/setup_teardown_test.go b/pfsagentd/setup_teardown_test.go index 31696ac90..552391ca9 100644 --- a/pfsagentd/setup_teardown_test.go +++ b/pfsagentd/setup_teardown_test.go @@ -14,9 +14,9 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/proxyfsd" - "github.com/swiftstack/ProxyFS/ramswift" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/proxyfsd" + "github.com/NVIDIA/proxyfs/ramswift" ) const ( diff --git a/pfsagentd/swift_proxy_emulator_test.go b/pfsagentd/swift_proxy_emulator_test.go index d006671c3..48511fa45 100644 --- a/pfsagentd/swift_proxy_emulator_test.go +++ b/pfsagentd/swift_proxy_emulator_test.go @@ -14,7 +14,7 @@ import ( "testing" "time" - "github.com/swiftstack/ProxyFS/conf" + "github.com/NVIDIA/proxyfs/conf" ) const ( diff --git a/pfsagentd/unit_test.go b/pfsagentd/unit_test.go index c579d6022..2a168bf63 100644 --- a/pfsagentd/unit_test.go +++ b/pfsagentd/unit_test.go @@ -13,7 +13,7 @@ import ( "testing" "time" - "github.com/swiftstack/ProxyFS/jrpcfs" + "github.com/NVIDIA/proxyfs/jrpcfs" ) const ( diff --git a/pfsconfjson/main.go b/pfsconfjson/main.go index d828533be..180db5177 100644 --- a/pfsconfjson/main.go +++ b/pfsconfjson/main.go @@ -10,8 +10,8 @@ import ( "log" "os" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/transitions" ) func main() { diff --git a/pfsconfjsonpacked/main.go b/pfsconfjsonpacked/main.go index cd3182c24..fcd9576f2 100644 --- a/pfsconfjsonpacked/main.go +++ b/pfsconfjsonpacked/main.go @@ -9,8 +9,8 @@ import ( "log" "os" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/transitions" ) func main() { diff --git a/pfsworkout/main.go b/pfsworkout/main.go index 8ec7a8923..b575ccc5c 100644 --- a/pfsworkout/main.go +++ b/pfsworkout/main.go @@ -10,14 +10,14 @@ import ( "strconv" "time" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/fs" - "github.com/swiftstack/ProxyFS/headhunter" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/swiftclient" - "github.com/swiftstack/ProxyFS/trackedlock" - "github.com/swiftstack/ProxyFS/transitions" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/fs" + "github.com/NVIDIA/proxyfs/headhunter" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/swiftclient" + "github.com/NVIDIA/proxyfs/trackedlock" + "github.com/NVIDIA/proxyfs/transitions" + "github.com/NVIDIA/proxyfs/utils" ) const ( diff --git a/proxyfsd/daemon.go b/proxyfsd/daemon.go index 6b4b47ef8..0b9002b9f 100644 --- a/proxyfsd/daemon.go +++ b/proxyfsd/daemon.go @@ -14,13 +14,13 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/transitions" - "github.com/swiftstack/ProxyFS/version" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/transitions" + "github.com/NVIDIA/proxyfs/version" // Force importing of the following "top-most" package - _ "github.com/swiftstack/ProxyFS/httpserver" + _ "github.com/NVIDIA/proxyfs/httpserver" ) // Daemon is launched as a GoRoutine that launches ProxyFS. During startup, the parent should read errChan diff --git a/proxyfsd/daemon_test.go b/proxyfsd/daemon_test.go index 9a3a834e6..84980b224 100644 --- a/proxyfsd/daemon_test.go +++ b/proxyfsd/daemon_test.go @@ -16,9 +16,9 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/fs" - "github.com/swiftstack/ProxyFS/inode" - "github.com/swiftstack/ProxyFS/ramswift" + "github.com/NVIDIA/proxyfs/fs" + "github.com/NVIDIA/proxyfs/inode" + "github.com/NVIDIA/proxyfs/ramswift" ) func TestMain(m *testing.M) { diff --git a/proxyfsd/proxyfsd/main.go b/proxyfsd/proxyfsd/main.go index 9abb351e9..82933f7f9 100644 --- a/proxyfsd/proxyfsd/main.go +++ b/proxyfsd/proxyfsd/main.go @@ -13,7 +13,7 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/proxyfsd" + "github.com/NVIDIA/proxyfs/proxyfsd" ) func main() { diff --git a/ramswift/daemon.go b/ramswift/daemon.go index ab7f4d864..48108c6d6 100644 --- a/ramswift/daemon.go +++ b/ramswift/daemon.go @@ -22,11 +22,11 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/sortedmap" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/transitions" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/transitions" + "github.com/NVIDIA/proxyfs/utils" ) type swiftAccountStruct struct { diff --git a/ramswift/daemon_test.go b/ramswift/daemon_test.go index c87393b77..dcfff25c4 100644 --- a/ramswift/daemon_test.go +++ b/ramswift/daemon_test.go @@ -14,7 +14,7 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/utils" ) func TestViaNoAuthClient(t *testing.T) { diff --git a/ramswift/ramswift/main.go b/ramswift/ramswift/main.go index 7d11cd9df..a94373f1e 100644 --- a/ramswift/ramswift/main.go +++ b/ramswift/ramswift/main.go @@ -9,7 +9,7 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/ramswift" + "github.com/NVIDIA/proxyfs/ramswift" ) func main() { diff --git a/retryrpc/api.go b/retryrpc/api.go index 589e5bad2..0463a1266 100644 --- a/retryrpc/api.go +++ b/retryrpc/api.go @@ -22,8 +22,8 @@ import ( "time" "github.com/google/btree" - "github.com/swiftstack/ProxyFS/bucketstats" - "github.com/swiftstack/ProxyFS/logger" + "github.com/NVIDIA/proxyfs/bucketstats" + "github.com/NVIDIA/proxyfs/logger" ) // ServerCreds tracks the root CA and the diff --git a/retryrpc/api_internal.go b/retryrpc/api_internal.go index a3e070652..2e25c1f4c 100644 --- a/retryrpc/api_internal.go +++ b/retryrpc/api_internal.go @@ -23,8 +23,8 @@ import ( "sync" "time" - "github.com/swiftstack/ProxyFS/bucketstats" - "github.com/swiftstack/ProxyFS/logger" + "github.com/NVIDIA/proxyfs/bucketstats" + "github.com/NVIDIA/proxyfs/logger" ) // PayloadProtocols defines the supported protocols for the payload diff --git a/retryrpc/client.go b/retryrpc/client.go index bbc79c065..4c2b8728d 100644 --- a/retryrpc/client.go +++ b/retryrpc/client.go @@ -13,8 +13,8 @@ import ( "time" "github.com/google/btree" - "github.com/swiftstack/ProxyFS/bucketstats" - "github.com/swiftstack/ProxyFS/logger" + "github.com/NVIDIA/proxyfs/bucketstats" + "github.com/NVIDIA/proxyfs/logger" ) const ( diff --git a/retryrpc/retryrpc_test.go b/retryrpc/retryrpc_test.go index d99fdc3ed..ac0f6b22f 100644 --- a/retryrpc/retryrpc_test.go +++ b/retryrpc/retryrpc_test.go @@ -8,8 +8,8 @@ import ( "time" "github.com/stretchr/testify/assert" - "github.com/swiftstack/ProxyFS/bucketstats" - "github.com/swiftstack/ProxyFS/retryrpc/rpctest" + "github.com/NVIDIA/proxyfs/bucketstats" + "github.com/NVIDIA/proxyfs/retryrpc/rpctest" ) // Test basic retryrpc primitives diff --git a/retryrpc/rpctest/ping.go b/retryrpc/rpctest/ping.go index 24f70a91f..f008a1156 100644 --- a/retryrpc/rpctest/ping.go +++ b/retryrpc/rpctest/ping.go @@ -8,7 +8,7 @@ import ( "bytes" "fmt" - "github.com/swiftstack/ProxyFS/blunder" + "github.com/NVIDIA/proxyfs/blunder" ) func encodeErrno(e *error) { diff --git a/retryrpc/server.go b/retryrpc/server.go index ede0708b6..c44bd624e 100644 --- a/retryrpc/server.go +++ b/retryrpc/server.go @@ -14,8 +14,8 @@ import ( "sync" "time" - "github.com/swiftstack/ProxyFS/bucketstats" - "github.com/swiftstack/ProxyFS/logger" + "github.com/NVIDIA/proxyfs/bucketstats" + "github.com/NVIDIA/proxyfs/logger" "golang.org/x/sys/unix" ) diff --git a/retryrpc/stress_test.go b/retryrpc/stress_test.go index 97c0e6501..aa083774e 100644 --- a/retryrpc/stress_test.go +++ b/retryrpc/stress_test.go @@ -15,7 +15,7 @@ import ( */ "github.com/stretchr/testify/assert" - "github.com/swiftstack/ProxyFS/retryrpc/rpctest" + "github.com/NVIDIA/proxyfs/retryrpc/rpctest" ) func TestStress(t *testing.T) { diff --git a/retryrpc/upcall_test.go b/retryrpc/upcall_test.go index 626126e56..35d7124e7 100644 --- a/retryrpc/upcall_test.go +++ b/retryrpc/upcall_test.go @@ -9,7 +9,7 @@ import ( "time" "github.com/stretchr/testify/assert" - "github.com/swiftstack/ProxyFS/retryrpc/rpctest" + "github.com/NVIDIA/proxyfs/retryrpc/rpctest" ) // Test Upcall() functionality diff --git a/stats/api_test.go b/stats/api_test.go index 080377f03..54c15ed90 100644 --- a/stats/api_test.go +++ b/stats/api_test.go @@ -12,8 +12,8 @@ import ( "testing" "time" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/transitions" ) type testGlobalsStruct struct { diff --git a/stats/config.go b/stats/config.go index 3df90b1db..916d65cbe 100644 --- a/stats/config.go +++ b/stats/config.go @@ -9,9 +9,9 @@ import ( "strconv" "time" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/trackedlock" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/trackedlock" + "github.com/NVIDIA/proxyfs/transitions" ) const ( diff --git a/stats/sender.go b/stats/sender.go index 124e50b68..0955b5862 100644 --- a/stats/sender.go +++ b/stats/sender.go @@ -8,7 +8,7 @@ import ( "net" "strconv" // XXX TODO: Can't call logger from here since logger calls stats. - //"github.com/swiftstack/ProxyFS/logger" + //"github.com/NVIDIA/proxyfs/logger" ) func sender() { diff --git a/statslogger/config.go b/statslogger/config.go index 77b2f037b..0c753eb58 100644 --- a/statslogger/config.go +++ b/statslogger/config.go @@ -8,12 +8,12 @@ import ( "strings" "time" - "github.com/swiftstack/ProxyFS/bucketstats" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/stats" - "github.com/swiftstack/ProxyFS/swiftclient" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/bucketstats" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/stats" + "github.com/NVIDIA/proxyfs/swiftclient" + "github.com/NVIDIA/proxyfs/transitions" ) type globalsStruct struct { diff --git a/statslogger/config_test.go b/statslogger/config_test.go index f52d8f714..904af1148 100644 --- a/statslogger/config_test.go +++ b/statslogger/config_test.go @@ -22,10 +22,10 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/ramswift" - "github.com/swiftstack/ProxyFS/swiftclient" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/ramswift" + "github.com/NVIDIA/proxyfs/swiftclient" + "github.com/NVIDIA/proxyfs/transitions" ) func (tOCCS *testObjectCopyCallbackStruct) BytesRemaining(bytesRemaining uint64) (chunkSize uint64) { diff --git a/swiftclient/account.go b/swiftclient/account.go index 9e4dd7949..33bec5d96 100644 --- a/swiftclient/account.go +++ b/swiftclient/account.go @@ -9,10 +9,10 @@ import ( "fmt" "net/url" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/evtlog" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/stats" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/evtlog" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/stats" ) func accountDeleteWithRetry(accountName string) (err error) { diff --git a/swiftclient/api_test.go b/swiftclient/api_test.go index c6546cfa8..7ed025c0d 100644 --- a/swiftclient/api_test.go +++ b/swiftclient/api_test.go @@ -18,12 +18,12 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/bucketstats" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/ramswift" - "github.com/swiftstack/ProxyFS/stats" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/bucketstats" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/ramswift" + "github.com/NVIDIA/proxyfs/stats" + "github.com/NVIDIA/proxyfs/transitions" ) type testObjectCopyCallbackStruct struct { diff --git a/swiftclient/config.go b/swiftclient/config.go index 9dbba5263..a6b3176d5 100644 --- a/swiftclient/config.go +++ b/swiftclient/config.go @@ -10,11 +10,11 @@ import ( "strconv" "time" - "github.com/swiftstack/ProxyFS/bucketstats" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/trackedlock" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/bucketstats" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/trackedlock" + "github.com/NVIDIA/proxyfs/transitions" ) type connectionStruct struct { diff --git a/swiftclient/container.go b/swiftclient/container.go index a17a046e9..0936dc516 100644 --- a/swiftclient/container.go +++ b/swiftclient/container.go @@ -9,10 +9,10 @@ import ( "fmt" "net/url" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/evtlog" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/stats" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/evtlog" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/stats" ) func containerDeleteWithRetry(accountName string, containerName string) (err error) { diff --git a/swiftclient/http_status.go b/swiftclient/http_status.go index bb8200daa..8a685498f 100644 --- a/swiftclient/http_status.go +++ b/swiftclient/http_status.go @@ -6,7 +6,7 @@ package swiftclient import ( - "github.com/swiftstack/ProxyFS/blunder" + "github.com/NVIDIA/proxyfs/blunder" ) func httpStatusIsSuccess(httpStatus int) (isSuccess bool) { diff --git a/swiftclient/object.go b/swiftclient/object.go index b57ab18a5..936fdcd88 100644 --- a/swiftclient/object.go +++ b/swiftclient/object.go @@ -13,13 +13,13 @@ import ( "time" "github.com/creachadair/cityhash" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/sortedmap" - "github.com/swiftstack/ProxyFS/blunder" - "github.com/swiftstack/ProxyFS/evtlog" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/stats" - "github.com/swiftstack/ProxyFS/trackedlock" + "github.com/NVIDIA/proxyfs/blunder" + "github.com/NVIDIA/proxyfs/evtlog" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/stats" + "github.com/NVIDIA/proxyfs/trackedlock" ) func objectContentLengthWithRetry(accountName string, containerName string, objectName string) (uint64, error) { diff --git a/swiftclient/retry.go b/swiftclient/retry.go index 9cf426c89..f6defc4f1 100644 --- a/swiftclient/retry.go +++ b/swiftclient/retry.go @@ -9,9 +9,9 @@ import ( "fmt" "time" - "github.com/swiftstack/ProxyFS/bucketstats" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/stats" + "github.com/NVIDIA/proxyfs/bucketstats" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/stats" ) // Swift requests should be retried if they fail with a retriable error. diff --git a/swiftclient/utils.go b/swiftclient/utils.go index acc452aca..ec344fb46 100644 --- a/swiftclient/utils.go +++ b/swiftclient/utils.go @@ -14,9 +14,9 @@ import ( "sync" "sync/atomic" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/stats" - "github.com/swiftstack/ProxyFS/version" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/stats" + "github.com/NVIDIA/proxyfs/version" ) const swiftVersion = "v1" diff --git a/trackedlock/api.go b/trackedlock/api.go index 8a9234ee5..6e81d6e3d 100644 --- a/trackedlock/api.go +++ b/trackedlock/api.go @@ -8,7 +8,7 @@ import ( "sync" "sync/atomic" - "github.com/swiftstack/ProxyFS/logger" + "github.com/NVIDIA/proxyfs/logger" ) /* diff --git a/trackedlock/api_internal.go b/trackedlock/api_internal.go index 3c69bea32..9ccb45639 100644 --- a/trackedlock/api_internal.go +++ b/trackedlock/api_internal.go @@ -9,8 +9,8 @@ import ( "sync/atomic" "time" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/utils" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/utils" ) type globalsStruct struct { diff --git a/trackedlock/api_test.go b/trackedlock/api_test.go index e4a2273d9..bfc9f8829 100644 --- a/trackedlock/api_test.go +++ b/trackedlock/api_test.go @@ -19,8 +19,8 @@ import ( "time" "unsafe" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/logger" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/logger" ) // Common configuration for all tests (unless overridden) diff --git a/trackedlock/config.go b/trackedlock/config.go index 4648e11b9..5a61f3cc7 100644 --- a/trackedlock/config.go +++ b/trackedlock/config.go @@ -7,9 +7,9 @@ import ( "sync/atomic" "time" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/logger" - "github.com/swiftstack/ProxyFS/transitions" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/logger" + "github.com/NVIDIA/proxyfs/transitions" ) func parseConfMap(confMap conf.ConfMap) (err error) { diff --git a/transitions/api.go b/transitions/api.go index fa9ede358..217d3ebf0 100644 --- a/transitions/api.go +++ b/transitions/api.go @@ -4,7 +4,7 @@ package transitions import ( - "github.com/swiftstack/ProxyFS/conf" + "github.com/NVIDIA/proxyfs/conf" ) // Callbacks is the interface implemented by each package desiring notification of @@ -57,8 +57,8 @@ type Callbacks interface { // // package foo // -// import "github.com/swiftstack/ProxyFS/conf" -// import "github.com/swiftstack/ProxyFS/transitions" +// import "github.com/NVIDIA/proxyfs/conf" +// import "github.com/NVIDIA/proxyfs/transitions" // // type transitionsCallbackInterfaceStruct struct { // } diff --git a/transitions/api_internal.go b/transitions/api_internal.go index 8793d2c9f..a4ad494db 100644 --- a/transitions/api_internal.go +++ b/transitions/api_internal.go @@ -8,8 +8,8 @@ import ( "fmt" "sync" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/logger" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/logger" ) type loggerCallbacksInterfaceStruct struct { diff --git a/transitions/api_test.go b/transitions/api_test.go index d05a82774..960b1649f 100644 --- a/transitions/api_test.go +++ b/transitions/api_test.go @@ -8,7 +8,7 @@ import ( "sort" "testing" - "github.com/swiftstack/ProxyFS/conf" + "github.com/NVIDIA/proxyfs/conf" ) type testCallbacksInterfaceStruct struct { diff --git a/utils/api.go b/utils/api.go index fb9a37ca1..d5874391d 100644 --- a/utils/api.go +++ b/utils/api.go @@ -196,19 +196,19 @@ func StackTraceToGoId(buf []byte) uint64 { // // goroutine 1 [running]: // main.main() -// /vagrant/guest_workspaces/swift-runway-001/ProxyFS/src/github.com/swiftstack/ProxyFS/stacktrace.go:27 +0x21e +// /vagrant/guest_workspaces/swift-runway-001/ProxyFS/src/github.com/NVIDIA/proxyfs/stacktrace.go:27 +0x21e // // goroutine 5 [runnable]: // main.killTime() -// /vagrant/guest_workspaces/swift-runway-001/ProxyFS/src/github.com/swiftstack/ProxyFS/stacktrace.go:9 +// /vagrant/guest_workspaces/swift-runway-001/ProxyFS/src/github.com/NVIDIA/proxyfs/stacktrace.go:9 // created by main.main -// /vagrant/guest_workspaces/swift-runway-001/ProxyFS/src/github.com/swiftstack/ProxyFS/stacktrace.go:14 +0x47 +// /vagrant/guest_workspaces/swift-runway-001/ProxyFS/src/github.com/NVIDIA/proxyfs/stacktrace.go:14 +0x47 // // goroutine 7 [runnable]: // main.killTime() -// /vagrant/guest_workspaces/swift-runway-001/ProxyFS/src/github.com/swiftstack/ProxyFS/stacktrace.go:9 +// /vagrant/guest_workspaces/swift-runway-001/ProxyFS/src/github.com/NVIDIA/proxyfs/stacktrace.go:9 // created by main.main -// /vagrant/guest_workspaces/swift-runway-001/ProxyFS/src/github.com/swiftstack/ProxyFS/stacktrace.go:16 +0x77 +// /vagrant/guest_workspaces/swift-runway-001/ProxyFS/src/github.com/NVIDIA/proxyfs/stacktrace.go:16 +0x77 // func StackTracesToMap(buf []byte) (traceMap map[uint64]string, stateMap map[uint64]string) { From fe4adcb8379c8f45ed00d9b862c5ccdce2ac30dc Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Mon, 8 Feb 2021 10:25:28 -0800 Subject: [PATCH 033/160] Migrated .service files --- saio/usr/lib/systemd/system/pfsagentd.service | 2 +- saio/usr/lib/systemd/system/proxyfsd.service | 2 +- sait/sait1/usr/lib/systemd/system/proxyfsd.service | 2 +- sait/sait2/usr/lib/systemd/system/proxyfsd.service | 2 +- sait/sait3/usr/lib/systemd/system/proxyfsd.service | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/saio/usr/lib/systemd/system/pfsagentd.service b/saio/usr/lib/systemd/system/pfsagentd.service index 2b674e103..c0db0533f 100644 --- a/saio/usr/lib/systemd/system/pfsagentd.service +++ b/saio/usr/lib/systemd/system/pfsagentd.service @@ -6,7 +6,7 @@ After=proxyfsd.service Environment=PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/bin:/vagrant/bin Environment=GOTRACEBACK=crash LimitCORE=infinity -ExecStart=/vagrant/bin/pfsagentd /vagrant/src/github.com/swiftstack/ProxyFS/pfsagentd/pfsagent.conf +ExecStart=/vagrant/bin/pfsagentd /vagrant/src/github.com/NVIDIA/proxyfs/pfsagentd/pfsagent.conf ExecReload=/usr/bin/kill -HUP $MAINPID Restart=always diff --git a/saio/usr/lib/systemd/system/proxyfsd.service b/saio/usr/lib/systemd/system/proxyfsd.service index 41960917b..0ae0258f8 100644 --- a/saio/usr/lib/systemd/system/proxyfsd.service +++ b/saio/usr/lib/systemd/system/proxyfsd.service @@ -4,7 +4,7 @@ Description=Swift ProxyFS service [Service] Environment=GOTRACEBACK=crash LimitCORE=infinity -ExecStart=/vagrant/bin/proxyfsd /vagrant/src/github.com/swiftstack/ProxyFS/saio/proxyfs.conf +ExecStart=/vagrant/bin/proxyfsd /vagrant/src/github.com/NVIDIA/proxyfs/saio/proxyfs.conf ExecReload=/usr/bin/kill -HUP $MAINPID Restart=no KillMode=process diff --git a/sait/sait1/usr/lib/systemd/system/proxyfsd.service b/sait/sait1/usr/lib/systemd/system/proxyfsd.service index 38a806146..abfc477b6 100644 --- a/sait/sait1/usr/lib/systemd/system/proxyfsd.service +++ b/sait/sait1/usr/lib/systemd/system/proxyfsd.service @@ -4,7 +4,7 @@ Description=Swift ProxyFS service [Service] Environment=GOTRACEBACK=crash LimitCORE=infinity -ExecStart=/vagrant/bin/proxyfsd /vagrant/src/github.com/swiftstack/ProxyFS/sait/sait1/proxyfs.conf +ExecStart=/vagrant/bin/proxyfsd /vagrant/src/github.com/NVIDIA/proxyfs/sait/sait1/proxyfs.conf ExecReload=/usr/bin/kill -HUP $MAINPID Restart=no KillMode=process diff --git a/sait/sait2/usr/lib/systemd/system/proxyfsd.service b/sait/sait2/usr/lib/systemd/system/proxyfsd.service index 90f779cf9..eb1cae9fc 100644 --- a/sait/sait2/usr/lib/systemd/system/proxyfsd.service +++ b/sait/sait2/usr/lib/systemd/system/proxyfsd.service @@ -4,7 +4,7 @@ Description=Swift ProxyFS service [Service] Environment=GOTRACEBACK=crash LimitCORE=infinity -ExecStart=/vagrant/bin/proxyfsd /vagrant/src/github.com/swiftstack/ProxyFS/sait/sait2/proxyfs.conf +ExecStart=/vagrant/bin/proxyfsd /vagrant/src/github.com/NVIDIA/proxyfs/sait/sait2/proxyfs.conf ExecReload=/usr/bin/kill -HUP $MAINPID Restart=no KillMode=process diff --git a/sait/sait3/usr/lib/systemd/system/proxyfsd.service b/sait/sait3/usr/lib/systemd/system/proxyfsd.service index ba2d6dacf..2ca6a19d3 100644 --- a/sait/sait3/usr/lib/systemd/system/proxyfsd.service +++ b/sait/sait3/usr/lib/systemd/system/proxyfsd.service @@ -4,7 +4,7 @@ Description=Swift ProxyFS service [Service] Environment=GOTRACEBACK=crash LimitCORE=infinity -ExecStart=/vagrant/bin/proxyfsd /vagrant/src/github.com/swiftstack/ProxyFS/sait/sait3/proxyfs.conf +ExecStart=/vagrant/bin/proxyfsd /vagrant/src/github.com/NVIDIA/proxyfs/sait/sait3/proxyfs.conf ExecReload=/usr/bin/kill -HUP $MAINPID Restart=no KillMode=process From 00bbfc68d065cc19725a27f4802bad224066dcf1 Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Mon, 8 Feb 2021 10:46:27 -0800 Subject: [PATCH 034/160] Migrated saio/sait files ...also migraded ".go_HIDE" files --- emswift/emswiftpkg/setup_teardown_test.go_HIDE | 6 +++--- .../swift_proxy_emulator_test.go_HIDE | 2 +- imgr/http_server.go_HIDE | 6 +++--- pfsagentd/container/build/Dockerfile | 8 ++++---- .../container/insert/MakePFSAgentDockerfile | 4 ++-- saio/Vagrantfile | 6 +++--- saio/bin/provision_middleware | 4 ++-- saio/bin/start_proxyfs_and_swift | 4 ++-- saio/bin/start_swift_only | 2 +- saio/container/Dockerfile | 8 ++++---- saio/vagrant_provision.sh | 18 +++++++++--------- sait/Vagrantfile | 6 +++--- sait/bin/provision_middleware | 4 ++-- sait/bin/start_proxyfs_and_swift | 4 ++-- sait/bin/start_swift_only | 2 +- sait/vagrant_provision.sh | 18 +++++++++--------- 16 files changed, 51 insertions(+), 51 deletions(-) diff --git a/emswift/emswiftpkg/setup_teardown_test.go_HIDE b/emswift/emswiftpkg/setup_teardown_test.go_HIDE index 5aa1e5b84..45d709cf6 100644 --- a/emswift/emswiftpkg/setup_teardown_test.go_HIDE +++ b/emswift/emswiftpkg/setup_teardown_test.go_HIDE @@ -14,9 +14,9 @@ import ( "golang.org/x/sys/unix" - "github.com/swiftstack/ProxyFS/conf" - "github.com/swiftstack/ProxyFS/proxyfsd" - "github.com/swiftstack/ProxyFS/ramswift" + "github.com/NVIDIA/proxyfs/conf" + "github.com/NVIDIA/proxyfs/proxyfsd" + "github.com/NVIDIA/proxyfs/ramswift" ) const ( diff --git a/emswift/emswiftpkg/swift_proxy_emulator_test.go_HIDE b/emswift/emswiftpkg/swift_proxy_emulator_test.go_HIDE index 8f44734c6..10ff83386 100644 --- a/emswift/emswiftpkg/swift_proxy_emulator_test.go_HIDE +++ b/emswift/emswiftpkg/swift_proxy_emulator_test.go_HIDE @@ -14,7 +14,7 @@ import ( "testing" "time" - "github.com/swiftstack/ProxyFS/conf" + "github.com/NVIDIA/proxyfs/conf" ) const ( diff --git a/imgr/http_server.go_HIDE b/imgr/http_server.go_HIDE index 486d54b13..faa8833dd 100644 --- a/imgr/http_server.go_HIDE +++ b/imgr/http_server.go_HIDE @@ -19,10 +19,10 @@ import ( "strings" "sync/atomic" - "github.com/swiftstack/sortedmap" + "github.com/NVIDIA/sortedmap" - "github.com/swiftstack/ProxyFS/bucketstats" - "github.com/swiftstack/ProxyFS/version" + "github.com/NVIDIA/proxyfs/bucketstats" + "github.com/NVIDIA/proxyfs/version" ) type leaseReportStruct struct { diff --git a/pfsagentd/container/build/Dockerfile b/pfsagentd/container/build/Dockerfile index 8e3dc06ac..5319f90d2 100644 --- a/pfsagentd/container/build/Dockerfile +++ b/pfsagentd/container/build/Dockerfile @@ -20,10 +20,10 @@ RUN tar -C /usr/local -xzf $GolangBasename ENV GOPATH /opt/PFSAgent/GOPATH ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin -RUN mkdir -p $GOPATH/src/github.com/swiftstack -WORKDIR $GOPATH/src/github.com/swiftstack -RUN git clone https://github.com/swiftstack/ProxyFS.git -WORKDIR $GOPATH/src/github.com/swiftstack/ProxyFS +RUN mkdir -p $GOPATH/src/github.com/NVIDIA +WORKDIR $GOPATH/src/github.com/NVIDIA +RUN git clone https://github.com/NVIDIA/proxyfs.git +WORKDIR $GOPATH/src/github.com/NVIDIA/proxyfs RUN git checkout $ProxyFS_Version RUN make version pfsagent diff --git a/pfsagentd/container/insert/MakePFSAgentDockerfile b/pfsagentd/container/insert/MakePFSAgentDockerfile index 97daf616c..d9de1037d 100755 --- a/pfsagentd/container/insert/MakePFSAgentDockerfile +++ b/pfsagentd/container/insert/MakePFSAgentDockerfile @@ -120,7 +120,7 @@ do docker cp $CONTAINER:/opt/PFSAgent/GOPATH/bin/pfsagentd . docker cp $CONTAINER:/opt/PFSAgent/GOPATH/bin/pfsagentd-init . docker cp $CONTAINER:/opt/PFSAgent/GOPATH/bin/pfsagentd-swift-auth-plugin . - docker cp $CONTAINER:/opt/PFSAgent/GOPATH/src/github.com/swiftstack/ProxyFS/pfsagentd/pfsagent.conf pfsagent.conf_TEMPLATE + docker cp $CONTAINER:/opt/PFSAgent/GOPATH/src/github.com/NVIDIA/proxyfs/pfsagentd/pfsagent.conf pfsagent.conf_TEMPLATE docker container rm $CONTAINER > /dev/null else if [[ $NEW_SECTION_NAME = "TEMPLATE" ]] @@ -180,7 +180,7 @@ then docker cp $CONTAINER:/opt/PFSAgent/GOPATH/bin/pfsagentd . docker cp $CONTAINER:/opt/PFSAgent/GOPATH/bin/pfsagentd-init . docker cp $CONTAINER:/opt/PFSAgent/GOPATH/bin/pfsagentd-swift-auth-plugin . - docker cp $CONTAINER:/opt/PFSAgent/GOPATH/src/github.com/swiftstack/ProxyFS/pfsagentd/pfsagent.conf pfsagent.conf_TEMPLATE + docker cp $CONTAINER:/opt/PFSAgent/GOPATH/src/github.com/NVIDIA/proxyfs/pfsagentd/pfsagent.conf pfsagent.conf_TEMPLATE docker container rm $CONTAINER > /dev/null fi diff --git a/saio/Vagrantfile b/saio/Vagrantfile index b3062cd46..621fdd2af 100644 --- a/saio/Vagrantfile +++ b/saio/Vagrantfile @@ -6,9 +6,9 @@ # 1) vboxnet0 is assumed to be a host-only network @ address 172.28.128.1 (DHCP disabled) # 2) Though not required, GOPATH is assumed to be the ../../../../../ directory # 3) The directory on the VM Host will be /vagrant on the VM and be the path in GOPATH -# 4) ProxyFS repo git clone'd to $GOPATH/src/github.com/swiftstack/ -# 5) samba repo automatically staged in $GOPATH/src/github.com/swiftstack/ProxyFS/saio/ -# 6) Swift repos et. al. git clone'd to $GOPATH/src/github.com/swiftstack/ProxyFS/saio/ +# 4) ProxyFS repo git clone'd to $GOPATH/src/github.com/NVIDIA/ +# 5) samba repo automatically staged in $GOPATH/src/github.com/NVIDIA/proxyfs/saio/ +# 6) Swift repos et. al. git clone'd to $GOPATH/src/github.com/NVIDIA/proxyfs/saio/ # 7) ../Makefile will be ready to be executed after `cdpfs` inside the VM # 8) As GOPATH is effectively shared between Host and VM, builds in the two environments # will collide in the contents of the $GOPATH/bin (only executables, not libraries) diff --git a/saio/bin/provision_middleware b/saio/bin/provision_middleware index 7cb669aca..1c1559e98 100755 --- a/saio/bin/provision_middleware +++ b/saio/bin/provision_middleware @@ -3,7 +3,7 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -cd $GOPATH/src/github.com/swiftstack/ProxyFS/pfs_middleware +cd $GOPATH/src/github.com/NVIDIA/proxyfs/pfs_middleware sudo python setup.py develop -cd $GOPATH/src/github.com/swiftstack/ProxyFS/meta_middleware +cd $GOPATH/src/github.com/NVIDIA/proxyfs/meta_middleware sudo python setup.py develop diff --git a/saio/bin/start_proxyfs_and_swift b/saio/bin/start_proxyfs_and_swift index dd8128dd3..6bf87bb3f 100755 --- a/saio/bin/start_proxyfs_and_swift +++ b/saio/bin/start_proxyfs_and_swift @@ -38,7 +38,7 @@ function await_swift_startup { } function format_volume_if_necessary { - sudo /vagrant/bin/mkproxyfs -I $1 /vagrant/src/github.com/swiftstack/ProxyFS/saio/proxyfs.conf SwiftClient.RetryLimit=1 + sudo /vagrant/bin/mkproxyfs -I $1 /vagrant/src/github.com/NVIDIA/proxyfs/saio/proxyfs.conf SwiftClient.RetryLimit=1 if [ $? -ne 0 ] then echo "Could not pre-format $1" @@ -49,7 +49,7 @@ function format_volume_if_necessary { sudo mount -a echo "Shutting down services and mount points..." -/vagrant/src/github.com/swiftstack/ProxyFS/saio/bin/unmount_and_stop_pfs +/vagrant/src/github.com/NVIDIA/proxyfs/saio/bin/unmount_and_stop_pfs echo echo "Bringing up services..." if [ -f /usr/bin/systemctl ]; then diff --git a/saio/bin/start_swift_only b/saio/bin/start_swift_only index b2e58f984..45edb5195 100755 --- a/saio/bin/start_swift_only +++ b/saio/bin/start_swift_only @@ -9,7 +9,7 @@ sudo mount -a echo "Shutting down services and mount points..." -/vagrant/src/github.com/swiftstack/ProxyFS/saio/bin/unmount_and_stop_pfs +/vagrant/src/github.com/NVIDIA/proxyfs/saio/bin/unmount_and_stop_pfs echo echo "Bringing up services..." if [ -f /usr/bin/systemctl ]; then diff --git a/saio/container/Dockerfile b/saio/container/Dockerfile index 77e5f3dea..634a94f82 100644 --- a/saio/container/Dockerfile +++ b/saio/container/Dockerfile @@ -167,10 +167,10 @@ ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin RUN yum install -y make fuse -RUN mkdir -p $GOPATH/src/github.com/swiftstack -WORKDIR $GOPATH/src/github.com/swiftstack -RUN git clone https://github.com/swiftstack/ProxyFS.git -WORKDIR $GOPATH/src/github.com/swiftstack/ProxyFS +RUN mkdir -p $GOPATH/src/github.com/NVIDIA +WORKDIR $GOPATH/src/github.com/NVIDIA +RUN git clone https://github.com/NVIDIA/proxyfs.git +WORKDIR $GOPATH/src/github.com/NVIDIA/proxyfs RUN git checkout $ProxyFS_Version RUN cd pfs_middleware && python setup.py develop diff --git a/saio/vagrant_provision.sh b/saio/vagrant_provision.sh index d8100bd10..895a39770 100644 --- a/saio/vagrant_provision.sh +++ b/saio/vagrant_provision.sh @@ -77,7 +77,7 @@ echo "export PATH=\$PATH:/usr/local/go/bin" >> ~vagrant/.bash_profile # Patch Golang's GDB runtime plug-in mv /usr/local/go/src/runtime/runtime-gdb.py /usr/local/go/src/runtime/runtime-gdb.py_ORIGINAL -cp /vagrant/src/github.com/swiftstack/ProxyFS/saio/usr/local/go/src/runtime/runtime-gdb.py /usr/local/go/src/runtime/. +cp /vagrant/src/github.com/NVIDIA/proxyfs/saio/usr/local/go/src/runtime/runtime-gdb.py /usr/local/go/src/runtime/. # Install GDB and enable above Golang GDB runtime plug-in as well as other niceties @@ -112,7 +112,7 @@ yum -y install json-c-devel yum -y install fuse echo "export GOPATH=/vagrant" >> ~vagrant/.bash_profile echo "export PATH=\$PATH:\$GOPATH/bin" >> ~vagrant/.bash_profile -echo "alias cdpfs=\"cd \$GOPATH/src/github.com/swiftstack/ProxyFS\"" >> ~vagrant/.bash_profile +echo "alias cdpfs=\"cd \$GOPATH/src/github.com/NVIDIA/proxyfs\"" >> ~vagrant/.bash_profile echo "alias goclean=\"go clean;go clean --cache;go clean --testcache\"" >> ~vagrant/.bash_profile echo "alias gogetdlv=\"go get -u github.com/go-delve/delve/cmd/dlv\"" >> ~vagrant/.bash_profile echo "user_allow_other" >> /etc/fuse.conf @@ -263,7 +263,7 @@ systemctl start memcached.service # [Setup Swift] Configuring each node rm -rf /etc/swift -cp -R /vagrant/src/github.com/swiftstack/ProxyFS/saio/etc/swift /etc/swift +cp -R /vagrant/src/github.com/NVIDIA/proxyfs/saio/etc/swift /etc/swift chown -R swift:swift /etc/swift # [Setup Swift] Setting up scripts for running Swift @@ -271,19 +271,19 @@ chown -R swift:swift /etc/swift mkdir -p ~swift/bin cd ~swift/bin -cp /vagrant/src/github.com/swiftstack/ProxyFS/saio/home/swift/bin/* . +cp /vagrant/src/github.com/NVIDIA/proxyfs/saio/home/swift/bin/* . echo "export PATH=\$PATH:~swift/bin" >> ~vagrant/.bash_profile ~swift/bin/remakerings # Install ProxyFS's pfs_middleware into the "normal" Swift Proxy pipeline -cd /vagrant/src/github.com/swiftstack/ProxyFS/pfs_middleware +cd /vagrant/src/github.com/NVIDIA/proxyfs/pfs_middleware python setup.py develop # Install ProxyFS's meta_middleware into the "NoAuth" Swift Proxy pipeline -cd /vagrant/src/github.com/swiftstack/ProxyFS/meta_middleware +cd /vagrant/src/github.com/NVIDIA/proxyfs/meta_middleware python setup.py develop # Setup AWS access for local vagrant user @@ -329,8 +329,8 @@ chmod 777 /CommonMountPoint # Install systemd .service files for ProxyFS -cp /vagrant/src/github.com/swiftstack/ProxyFS/saio/usr/lib/systemd/system/proxyfsd.service /usr/lib/systemd/system/. -cp /vagrant/src/github.com/swiftstack/ProxyFS/saio/usr/lib/systemd/system/pfsagentd.service /usr/lib/systemd/system/. +cp /vagrant/src/github.com/NVIDIA/proxyfs/saio/usr/lib/systemd/system/proxyfsd.service /usr/lib/systemd/system/. +cp /vagrant/src/github.com/NVIDIA/proxyfs/saio/usr/lib/systemd/system/pfsagentd.service /usr/lib/systemd/system/. # Place symlink in root's $PATH to locate pfsagentd-swift-auth-plugin referenced without a path @@ -344,7 +344,7 @@ semanage port -a -t smbd_port_t -p tcp 32345 # Enable start/stop tools -echo "export PATH=\$PATH:/vagrant/src/github.com/swiftstack/ProxyFS/saio/bin" >> ~vagrant/.bash_profile +echo "export PATH=\$PATH:/vagrant/src/github.com/NVIDIA/proxyfs/saio/bin" >> ~vagrant/.bash_profile # Install wireshark diff --git a/sait/Vagrantfile b/sait/Vagrantfile index e0f993930..1b8b3eb91 100644 --- a/sait/Vagrantfile +++ b/sait/Vagrantfile @@ -6,9 +6,9 @@ # 1) vboxnet0 is assumed to be a host-only network @ address 172.28.128.1 (DHCP disabled) # 2) Though not required, GOPATH is assumed to be the ../../../../../ directory # 3) The directory on the VM Host will be /vagrant on the VM and be the path in GOPATH -# 4) ProxyFS repo git clone'd to $GOPATH/src/github.com/swiftstack/ -# 5) samba repo automatically staged in $GOPATH/src/github.com/swiftstack/ProxyFS/saio/ -# 6) Swift repos et. al. git clone'd to $GOPATH/src/github.com/swiftstack/ProxyFS/saio/ +# 4) ProxyFS repo git clone'd to $GOPATH/src/github.com/NVIDIA/ +# 5) samba repo automatically staged in $GOPATH/src/github.com/NVIDIA/proxyfs/saio/ +# 6) Swift repos et. al. git clone'd to $GOPATH/src/github.com/NVIDIA/proxyfs/saio/ # 7) ../Makefile will be ready to be executed after `cdpfs` inside the VM # 8) As GOPATH is effectively shared between Host and VM, builds in the two environments # will collide in the contents of the $GOPATH/bin (only executables, not libraries) diff --git a/sait/bin/provision_middleware b/sait/bin/provision_middleware index 7cb669aca..1c1559e98 100755 --- a/sait/bin/provision_middleware +++ b/sait/bin/provision_middleware @@ -3,7 +3,7 @@ # Copyright (c) 2015-2021, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 -cd $GOPATH/src/github.com/swiftstack/ProxyFS/pfs_middleware +cd $GOPATH/src/github.com/NVIDIA/proxyfs/pfs_middleware sudo python setup.py develop -cd $GOPATH/src/github.com/swiftstack/ProxyFS/meta_middleware +cd $GOPATH/src/github.com/NVIDIA/proxyfs/meta_middleware sudo python setup.py develop diff --git a/sait/bin/start_proxyfs_and_swift b/sait/bin/start_proxyfs_and_swift index 49e7e1f64..28e2ba686 100755 --- a/sait/bin/start_proxyfs_and_swift +++ b/sait/bin/start_proxyfs_and_swift @@ -56,7 +56,7 @@ function await_swift_startup { function format_volume_if_necessary { if [ "" != "$1" ] then - sudo /vagrant/bin/mkproxyfs -I $1 /vagrant/src/github.com/swiftstack/ProxyFS/sait/$SAIT_DIR/proxyfs.conf SwiftClient.RetryLimit=1 + sudo /vagrant/bin/mkproxyfs -I $1 /vagrant/src/github.com/NVIDIA/proxyfs/sait/$SAIT_DIR/proxyfs.conf SwiftClient.RetryLimit=1 if [ $? -ne 0 ] then echo "Could not pre-format $1" @@ -68,7 +68,7 @@ function format_volume_if_necessary { sudo mount -a echo "Shutting down services and mount points..." -/vagrant/src/github.com/swiftstack/ProxyFS/sait/bin/unmount_and_stop_pfs +/vagrant/src/github.com/NVIDIA/proxyfs/sait/bin/unmount_and_stop_pfs echo echo "Bringing up services..." if [ -f /usr/bin/systemctl ]; then diff --git a/sait/bin/start_swift_only b/sait/bin/start_swift_only index 52f4cc618..3269977bf 100755 --- a/sait/bin/start_swift_only +++ b/sait/bin/start_swift_only @@ -6,7 +6,7 @@ sudo mount -a echo "Shutting down services and mount points..." -/vagrant/src/github.com/swiftstack/ProxyFS/sait/bin/unmount_and_stop_pfs +/vagrant/src/github.com/NVIDIA/proxyfs/sait/bin/unmount_and_stop_pfs echo echo "Bringing up services..." if [ -f /usr/bin/systemctl ]; then diff --git a/sait/vagrant_provision.sh b/sait/vagrant_provision.sh index e51e55649..6508454d1 100644 --- a/sait/vagrant_provision.sh +++ b/sait/vagrant_provision.sh @@ -79,7 +79,7 @@ echo "export PATH=\$PATH:/usr/local/go/bin" >> ~vagrant/.bash_profile # Patch Golang's GDB runtime plug-in mv /usr/local/go/src/runtime/runtime-gdb.py /usr/local/go/src/runtime/runtime-gdb.py_ORIGINAL -cp /vagrant/src/github.com/swiftstack/ProxyFS/sait/usr/local/go/src/runtime/runtime-gdb.py /usr/local/go/src/runtime/. +cp /vagrant/src/github.com/NVIDIA/proxyfs/sait/usr/local/go/src/runtime/runtime-gdb.py /usr/local/go/src/runtime/. # Install GDB and enable above Golang GDB runtime plug-in as well as other niceties @@ -114,7 +114,7 @@ yum -y install json-c-devel yum -y install fuse echo "export GOPATH=/vagrant" >> ~vagrant/.bash_profile echo "export PATH=\$PATH:\$GOPATH/bin" >> ~vagrant/.bash_profile -echo "alias cdpfs=\"cd \$GOPATH/src/github.com/swiftstack/ProxyFS\"" >> ~vagrant/.bash_profile +echo "alias cdpfs=\"cd \$GOPATH/src/github.com/NVIDIA/proxyfs\"" >> ~vagrant/.bash_profile echo "alias goclean=\"go clean;go clean --cache;go clean --testcache\"" >> ~vagrant/.bash_profile echo "alias gogetdlv=\"go get -u github.com/go-delve/delve/cmd/dlv\"" >> ~vagrant/.bash_profile echo "user_allow_other" >> /etc/fuse.conf @@ -265,8 +265,8 @@ systemctl start memcached.service # [Setup Swift] Configuring each node rm -rf /etc/swift -cp -R /vagrant/src/github.com/swiftstack/ProxyFS/sait/etc/swift /etc/. -cp -R /vagrant/src/github.com/swiftstack/ProxyFS/sait/sait$SAIT_INSTANCE/etc/swift /etc/. +cp -R /vagrant/src/github.com/NVIDIA/proxyfs/sait/etc/swift /etc/. +cp -R /vagrant/src/github.com/NVIDIA/proxyfs/sait/sait$SAIT_INSTANCE/etc/swift /etc/. chown -R swift:swift /etc/swift # [Setup Swift] Setting up scripts for running Swift @@ -274,19 +274,19 @@ chown -R swift:swift /etc/swift mkdir -p ~swift/bin cd ~swift/bin -cp /vagrant/src/github.com/swiftstack/ProxyFS/sait/home/swift/bin/* . +cp /vagrant/src/github.com/NVIDIA/proxyfs/sait/home/swift/bin/* . echo "export PATH=\$PATH:~swift/bin" >> ~vagrant/.bash_profile ~swift/bin/remakerings # Install ProxyFS's pfs_middleware into the "normal" Swift Proxy pipeline -cd /vagrant/src/github.com/swiftstack/ProxyFS/pfs_middleware +cd /vagrant/src/github.com/NVIDIA/proxyfs/pfs_middleware python setup.py develop # Install ProxyFS's meta_middleware into the "NoAuth" Swift Proxy pipeline -cd /vagrant/src/github.com/swiftstack/ProxyFS/meta_middleware +cd /vagrant/src/github.com/NVIDIA/proxyfs/meta_middleware python setup.py develop # Setup AWS access for local vagrant user @@ -335,11 +335,11 @@ fi # Install systemd .service files for ProxyFS -cp /vagrant/src/github.com/swiftstack/ProxyFS/sait/sait$SAIT_INSTANCE/usr/lib/systemd/system/proxyfsd.service /usr/lib/systemd/system/. +cp /vagrant/src/github.com/NVIDIA/proxyfs/sait/sait$SAIT_INSTANCE/usr/lib/systemd/system/proxyfsd.service /usr/lib/systemd/system/. # Enable start/stop tools -echo "export PATH=\$PATH:/vagrant/src/github.com/swiftstack/ProxyFS/sait/bin" >> ~vagrant/.bash_profile +echo "export PATH=\$PATH:/vagrant/src/github.com/NVIDIA/proxyfs/sait/bin" >> ~vagrant/.bash_profile # Install wireshark From 8843c5cbbdeb601f063b6ff55e9532fb761859a9 Mon Sep 17 00:00:00 2001 From: Ed McClanahan Date: Mon, 8 Feb 2021 10:56:34 -0800 Subject: [PATCH 035/160] Migrated all but Go Modules files go.{mod|sum} --- docs/source/api/index.rst | 2 +- docs/source/architecture/access.rst | 4 ++-- docs/source/theme/swiftopensource/footer.html | 4 ++-- docs/source/theme/swiftopensource/header.html | 4 ++-- enmesh_in_gopath.sh | 8 ++++---- logger/README.md | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/source/api/index.rst b/docs/source/api/index.rst index a44b16044..7147449ec 100644 --- a/docs/source/api/index.rst +++ b/docs/source/api/index.rst @@ -12,7 +12,7 @@ Bimodal access A primary of the motivation for ProxyFS was to have the ability to read and write the same data in the same account whether accessing it via the object API or file system API. Such access is possible via the ``pfs`` `proxy middleware -`__, +`__, but there are numerous caveats. Writing via object API diff --git a/docs/source/architecture/access.rst b/docs/source/architecture/access.rst index 74ec88855..ceb9a2016 100644 --- a/docs/source/architecture/access.rst +++ b/docs/source/architecture/access.rst @@ -35,9 +35,9 @@ SMB Access – ProxyFS Samba VFS ProxyFS provides a Samba VFS module written in C that integrates directly with the Samba server processes. This module is provided in a separate repository called -`proxyfs-vfs `__. A ProxyFS +`proxyfs-vfs `__. A ProxyFS JSON RPC client is provided in a separate repository called -`proxyfs-jrpc-client `__. +`proxyfs-jrpc-client `__. The ProxyFS Samba VFS module utilizes the ProxyFS JSON RPC interface for direct access into ProxyFS for a given volume. diff --git a/docs/source/theme/swiftopensource/footer.html b/docs/source/theme/swiftopensource/footer.html index e919c8689..0a1f13aa6 100644 --- a/docs/source/theme/swiftopensource/footer.html +++ b/docs/source/theme/swiftopensource/footer.html @@ -4,7 +4,7 @@
diff --git a/docs/source/theme/swiftopensource/header.html b/docs/source/theme/swiftopensource/header.html index 6b0a64f9a..5874bce30 100644 --- a/docs/source/theme/swiftopensource/header.html +++ b/docs/source/theme/swiftopensource/header.html @@ -14,14 +14,14 @@