Container Library and FUSE Container File System Softwarepraktikum - - PowerPoint PPT Presentation

container library and fuse container file system
SMART_READER_LITE
LIVE PREVIEW

Container Library and FUSE Container File System Softwarepraktikum - - PowerPoint PPT Presentation

Introduction Container Library Container Tools FUSE Container File System Evaluation Container Library and FUSE Container File System Softwarepraktikum f ur Fortgeschrittene Michael Kuhn Parallele und Verteilte Systeme Institut f ur


slide-1
SLIDE 1

Introduction Container Library Container Tools FUSE Container File System Evaluation

Container Library and FUSE Container File System

Softwarepraktikum f¨ ur Fortgeschrittene Michael Kuhn

Parallele und Verteilte Systeme Institut f¨ ur Informatik Ruprecht-Karls-Universit¨ at Heidelberg

2008-02-29

1 / 22

slide-2
SLIDE 2

Introduction Container Library Container Tools FUSE Container File System Evaluation

1

Introduction Introduction Requirements

2

Container Library

3

Container Tools

4

FUSE Container File System

5

Evaluation

2 / 22

slide-3
SLIDE 3

Introduction Container Library Container Tools FUSE Container File System Evaluation Introduction

An attempt to decrease the metadata overhead is to maintain a reduced set of metadata files This usually has to be done manually

Available file systems do not permit the user to change which metadata is stored

One approach is to pack them together in one file – a container

The file system only manages metadata for one file

Within this container, the files and their corresponding metadata can be managed arbitrarily

3 / 22

slide-4
SLIDE 4

Introduction Container Library Container Tools FUSE Container File System Evaluation Requirements

The container format should enable random access to provide access times independent of the position of a file within the container Existing formats are insufficient

The tar format does not provide random access The iso format stores too much metadata

Therefore a new container format was designed and implemented by Hendrik Heinrich This existing implementation was used as a basis for all work presented here

4 / 22

slide-5
SLIDE 5

Introduction Container Library Container Tools FUSE Container File System Evaluation

1

Introduction

2

Container Library License General Overhaul New Features

3

Container Tools

4

FUSE Container File System

5

Evaluation

5 / 22

slide-6
SLIDE 6

Introduction Container Library Container Tools FUSE Container File System Evaluation License

The container library was not licensed in any way

This made future development and usage difficult

It has been licensed under a 2-clause BSD license in agreement with the original author

6 / 22

slide-7
SLIDE 7

Introduction Container Library Container Tools FUSE Container File System Evaluation General Overhaul

The library was completely overhauled

It now provides consistently named functions and data types

The comments within the code were modified to allow the automatic generation of an API documentation with Doxygen

7 / 22

slide-8
SLIDE 8

Introduction Container Library Container Tools FUSE Container File System Evaluation New Features

Architecture Independence

The original implementation did not honor the different sizes

  • f data types on 32 and 64 bit architectures

This made it impossible to use a container created with a 32 bit version of the library with a 64 bit version and vice versa

By using datatypes of a fixed size the containers can now be used on both 32 and 64 bit architectures without problems The size of the metadata structures used in the library is now independent of the architecture

C pads structures for better memory alignment

8 / 22

slide-9
SLIDE 9

Introduction Container Library Container Tools FUSE Container File System Evaluation New Features

Thread-Safety

The library was not thread-safe in its original form

It uses a shared file pointer for all files in a container The functions read and write were used in combination with lseek

The library was modified to use the pread and pwrite functions that do not modify the shared file pointer It can now be used safely in multi-threaded applications

9 / 22

slide-10
SLIDE 10

Introduction Container Library Container Tools FUSE Container File System Evaluation New Features

Write Support

The original version of the container library lacked an easy-to-use method to create containers A convenient interface to add new files was added to the library

Either from memory with ct file create buffer Or from an existing file with ct file create path

There are currently also “fast” versions of these functions

10 / 22

slide-11
SLIDE 11

Introduction Container Library Container Tools FUSE Container File System Evaluation New Features

File Hashing

File data stored in the container is protected from silent corruption Currently a SHA-1 hash of it is stored along with its metadata This also needs to be done for the metadata

11 / 22

slide-12
SLIDE 12

Introduction Container Library Container Tools FUSE Container File System Evaluation

1

Introduction

2

Container Library

3

Container Tools Overview Tools

4

FUSE Container File System

5

Evaluation

12 / 22

slide-13
SLIDE 13

Introduction Container Library Container Tools FUSE Container File System Evaluation Overview

Five tools to work with containers on the command line

ctcat ctcp ctls ctmk ctpc

13 / 22

slide-14
SLIDE 14

Introduction Container Library Container Tools FUSE Container File System Evaluation Tools

ctcat

Print the contents of a file in a container to stdout

ctcp

Copy a file from a container to a local file system

ctls

Print the names of all files in a container Optionally also print their hashes or sizes

ctmk

Create a new container with all files in a given directory

ctpc

Copy a file from a local file system to a container

14 / 22

slide-15
SLIDE 15

Introduction Container Library Container Tools FUSE Container File System Evaluation

1

Introduction

2

Container Library

3

Container Tools

4

FUSE Container File System Motivation Realization

5

Evaluation

15 / 22

slide-16
SLIDE 16

Introduction Container Library Container Tools FUSE Container File System Evaluation Motivation

There are legacy applications that use the POSIX API and can not be ported

It may be too much work to port them Or the source code is not available at all

Provide POSIX access to containers The easiest way to do this is to write a FUSE file system

16 / 22

slide-17
SLIDE 17

Introduction Container Library Container Tools FUSE Container File System Evaluation Realization

Provide an overlay file system

The whole underlying file system is accessible Directories are handled normally – as directories Files are handled as containers – that is, also as directories

For example

ctfs is mounted at /ctfs There is a container available as /storage/stuff.ct All files within this container would be available in the directory /ctfs/storage/stuff

There is more room for optimization

Does two stat() calls for each container file One can be eliminated easily

17 / 22

slide-18
SLIDE 18

Introduction Container Library Container Tools FUSE Container File System Evaluation

1

Introduction

2

Container Library

3

Container Tools

4

FUSE Container File System

5

Evaluation Evaluation

18 / 22

slide-19
SLIDE 19

Introduction Container Library Container Tools FUSE Container File System Evaluation Evaluation

POSIX ctfs ct 5 10 15 20 25 30 35 40 45

Without Metadata (First Execution)

10,000 100,000 1,000,000

Time (in seconds)

19 / 22

slide-20
SLIDE 20

Introduction Container Library Container Tools FUSE Container File System Evaluation Evaluation

POSIX ctfs ct 0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9 1

Without Metadata

10,000 100,000 1,000,000

Time (in seconds)

20 / 22

slide-21
SLIDE 21

Introduction Container Library Container Tools FUSE Container File System Evaluation Evaluation

POSIX ctfs ct 100 200 300 400 500 600 700

With Metadata (First Execution)

10,000 100,000 1,000,000

Time (in seconds)

21 / 22

slide-22
SLIDE 22

Introduction Container Library Container Tools FUSE Container File System Evaluation Evaluation

POSIX ctfs ct 20 40 60 80 100 120 140 160 180

With Metadata

10,000 100,000 1,000,000

Time (in seconds)

22 / 22