abfs

command module
v0.0.0-...-cfd93f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2021 License: MIT Imports: 14 Imported by: 0

README

abfs

Abfs provides a platform/network agnostic expression of an Azure blob storage container as a directory hierarchy which could be interacted with as though it were any other directory on a system.

A user should be able to list, create, edit, and delete files in an Azure blob storage container and view these over a 9p file system.

A reasonable way of testing this could be through a Linux VM with support for FUSE and utilize 9pfuse, 9pfs, or the v9fs kernel module. WSL2 could probably mount 9p using 9pfuse, but WSL1 lacks FUSE support.

On Windows natively, testing for 9p could be done through the Inferno virtual machine. The purgatorio fork runs on Windows 10 and builds in VS2019.

Dependencies

Written in Golang: https://golang.ir

Imports:

  • github.com/Azure/azure-storage-blob-go
  • aqwari.net/net/styx

Build

go build

Test

go test

Run

abfs

Usage

The > rune indicates a command run in Powershell.

The $ rune indicates a command run in bash(1) under WSL.

The ; rune indicates a command run in sh(1) under Inferno.

Serve over tcp locally and leverage from Inferno

From Windows Powershell:

> $Env:AZURE_STORAGE_ACCOUNT = "<youraccountname>"
> $Env:AZURE_STORAGE_ACCESS_KEY = "<youraccountkey>"
> abfs -p ':1337'
...

From Windows Powershell to Inferno:

> emu
; mount -A 'tcp!127.0.0.1!1337' /n/abfs
; ls /n/abfs
/n/abfs/foo
;
Serve over tcp locally and leverage from WSL

From Windows Powershell:

> $Env:AZURE_STORAGE_ACCOUNT = "<youraccountname>"
> $Env:AZURE_STORAGE_ACCESS_KEY = "<youraccountkey>"
> abfs -p ':1337'
...

From WSL using plan9port's 9p(1) command:

$ 9p -a 'tcp!127.0.0.1!1337' ls
foo
$

Functionality

The file system is currently very slow due to the unreasonably large number of sync operations due to a lack of remote change detection before making further calls.

Implemented and working
  • Create
  • Read
  • Write
  • Delete
  • Stat
  • TCP listening
Not Implemented
  • Wstat
  • Nested directories
  • Listening on protocols/interfaces other than TCP

Contribute

Please PR on GitHub :)

Please comment all functions, structs, and major - shared - variables.

Please run go fmt and go vet on source before submitting the PR.

History

Abfs was written for and during the 2020 hackathon at Microsoft.

References

Tools

Documentation

Overview

9p server-specific functionality

Contains Azure blob information for use with File

Implements an abstract file system TODO - rewrite with the io/fs package if the proposal completes ^ See: https://go.googlesource.com/proposal/+/master/design/draft-iofs.md

Copyright (c) 2020 Microsoft Corporation, Sean Hinchee. Licensed under the MIT License.

Misc utility functions

These are special overrides to make styx interface casting work correctly The only important bit is that these interfaces need non-pointer receivers As such, we store a reference to a File and implement non-pointer receivers This simplifies the implementation significantly from the File side See: https://golang.ir/play/p/Au12mZbdiHX

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL