Skip to content

Commit

Permalink
Quick retro-fit of the old static-config, to allow external builds wi…
Browse files Browse the repository at this point in the history
…thout PA2X

PA2X has not been released outside of LANL, yet.  This means non-LANL sites
can't build run MarFS at all.  However, we still have some vestigial
support for our old "static" configuration, which hasn't been used in a
while.  I dusted it off, made a few tweaks to get it to build, and I can
successfully mount fuse with it, and do a simple write and read.  I haven't
validated it more deeply than that.

To build this, you might do something like this:

  cd $AWS4C; make clean && make
  cd $FUSE;  make clean && make mnt STATIC_CONFIG=1

i.e. skipping the usual build in marfs/common/configuration/src
  • Loading branch information
jti-lanl committed Nov 10, 2015
1 parent ff17282 commit b7adc35
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 154 deletions.
18 changes: 14 additions & 4 deletions fuse/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -664,10 +664,6 @@ foo.multi.4096:
dd if=/dev/zero bs=224 count=1 | tr '\0' '4' >> foo.multi.4096


# applications that link with various marfs support libs
demo_%: demo_%.o $(OBJS)
gcc -o $@ $< $(LDFLAGS) $(LIBS) $(OBJS)

# test app that links with assembly-code
test_lock: test_lock.c spinlock_asm.s
gcc -g -o $@ $^ -lpthread -lrt
Expand All @@ -679,6 +675,20 @@ test_lock2b: test_lock2b.c spinlock_asm.o spinlock.o
gcc -g -o $@ $^ -lpthread -lrt


# test-apps that may potentially use any of the various marfs support libs
demo_%: demo_%.o $(OBJS)
gcc -o $@ $< $(LDFLAGS) $(LIBS) $(OBJS)

test_%: test_%.c $(OBJS)
echo "test_$*"
@ $(MAKE) _test_$* LINK_LIBFUSE=1

_test_%:
echo "_test_$*"
@# gcc -o $@ $< $(LDFLAGS) $(LIBS) $(OBJS)
gcc $(CFLAGS) -o test_$* $(LDFLAGS) -L$(PWD) test_$*.c $(OBJS) $(LIBS) -lmarfs


# lines-of-code
loc:
wc -l $(H) $(SRCS)
Expand Down
175 changes: 25 additions & 150 deletions fuse/src/marfs_base_static_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,11 @@ int read_config(const char* config_fname) {
MarFS_Repo r_dummy;

r_dummy = (MarFS_Repo) {
.name = "sproxyd_jti", // repo is sproxyd: this must match fastcgi-path
.host = "10.135.0.21:81",
.name = "proxy", // repo is sproxyd: this must match fastcgi-path
.host = "10.135.0.%d:81",
.host_offset = 30,
.host_count = 4,
.access_method = ACCESSMETHOD_SPROXYD,
// .chunk_size = (1024 * 1024 * 256), /* max MarFS object (tune to match storage) */
// .chunk_size = (1024 * 1024 * 512), /* max MarFS object (tune to match storage) */
.chunk_size = (1024 * 1024 * 1028), /* max MarFS object (tune to match storage) */
.is_online = 1,
.auth = AUTH_S3_AWS_MASTER,
Expand All @@ -214,20 +214,6 @@ int read_config(const char* config_fname) {
};
push_repo(&r_dummy);

// For Alfred, testing GC and quota utilities
r_dummy = (MarFS_Repo) {
.name = "sproxyd_64M", // repo is sproxyd: this must match fastcgi-path
.host = "10.135.0.22:81",
.access_method = ACCESSMETHOD_SPROXYD,
.chunk_size = (1024 * 1024 * 64), /* max MarFS object (tune to match storage) */
.is_online = 1,
.auth = AUTH_S3_AWS_MASTER,
.compression = COMPRESS_NONE,
.correction = CORRECT_NONE,
.encryption = ENCRYPT_NONE,
.latency_ms = (10 * 1000) };
push_repo(&r_dummy);

// For Brett, unit-testing, small enough to make it easy to create MULTIs
r_dummy = (MarFS_Repo) {
.name = "sproxyd_1M", // repo is sproxyd: this must match fastcgi-path
Expand Down Expand Up @@ -258,23 +244,10 @@ int read_config(const char* config_fname) {
};
push_repo(&r_dummy);

// free-for-all
r_dummy = (MarFS_Repo) {
.name = "sproxyd_28", // repo is sproxyd: this must match fastcgi-path
.host = "10.135.0.28:81",
.access_method = ACCESSMETHOD_SPROXYD,
.chunk_size = (1024 * 1024 * 513), /* max MarFS object (tune to match storage) */
.is_online = 1,
.auth = AUTH_S3_AWS_MASTER,
.compression = COMPRESS_NONE,
.correction = CORRECT_NONE,
.encryption = ENCRYPT_NONE,
.latency_ms = (10 * 1000) };
push_repo(&r_dummy);

// S3 on EMC ECS
r_dummy = (MarFS_Repo) {
.name = "emcS3_00", // repo is s3: this must match existing bucket
.name = "emc_s3", // repo is s3: this must match existing bucket
.host = "10.140.0.15:9020", //"10.143.0.1:80",
.access_method = ACCESSMETHOD_S3_EMC,
.chunk_size = (1024 * 1024 * 256), /* max MarFS object (tune to match storage) */
Expand All @@ -287,21 +260,6 @@ int read_config(const char* config_fname) {
};
push_repo(&r_dummy);

// @@@-HTTPS: S3 on EMC ECS
r_dummy = (MarFS_Repo) {
.name = "emcS3_00_https", // repo is s3: this must match existing bucket
.host = "10.140.0.15:9021", //"10.143.0.1:443",
.access_method = ACCESSMETHOD_S3_EMC,
.chunk_size = (1024 * 1024 * 64), /* max MarFS object (tune to match storage) */
.is_online = 1,
.ssl = 1,
.auth = AUTH_S3_AWS_MASTER,
.compression = COMPRESS_NONE,
.correction = CORRECT_NONE,
.encryption = ENCRYPT_NONE,
.latency_ms = (10 * 1000),
};
push_repo(&r_dummy);

#if TBD
// semi-direct experiment
Expand Down Expand Up @@ -339,29 +297,6 @@ int read_config(const char* config_fname) {

MarFS_Namespace ns_dummy;

// Alfred
ns_dummy = (MarFS_Namespace) {
.name = "atorrez",
.mnt_path = "/atorrez", // "<mnt_top>/atorrez" comes here

.md_path = "/gpfs/marfs-gpfs/atorrez/mdfs",
.fsinfo_path = "/gpfs/marfs-gpfs/atorrez/fsinfo", /* a file */
.trash_md_path = "/gpfs/marfs-gpfs/trash", // NOT NEC IN THE SAME FILESET!

.iperms = ( R_META | W_META | R_DATA | W_DATA | T_DATA | U_DATA ),
.bperms = ( R_META | W_META | R_DATA | W_DATA | T_DATA | U_DATA ),

.dirty_pack_percent = 0,
.dirty_pack_threshold = 75,

.quota_space = -1, /* no limit */
.quota_names = -1, /* no limit */

.shard_path = NULL,
.shard_count = 0,
};
push_namespace(&ns_dummy, find_repo_by_name("sproxyd_1M"));


// Brett, unit
ns_dummy = (MarFS_Namespace) {
Expand Down Expand Up @@ -431,57 +366,7 @@ int read_config(const char* config_fname) {
.shard_path = NULL,
.shard_count = 0,
};
// push_namespace(&ns_dummy, find_repo_by_name("emcS3_00"));
// push_namespace(&ns_dummy, find_repo_by_name("sproxyd_2k"));
push_namespace(&ns_dummy, find_repo_by_name("sproxyd_jti"));


// Chris DeJager
ns_dummy = (MarFS_Namespace) {
.name = "dejager",
.mnt_path = "/dejager", // "<mnt_top>/dejager" comes here

.md_path = "/gpfs/fs1/dejager/mdfs",
.fsinfo_path = "/gpfs/fs1/dejager/fsinfo", /* a file */
.trash_md_path = "/gpfs/fs1/trash", // NOT NEC IN THE SAME FILESET!

.iperms = ( R_META | W_META | R_DATA | W_DATA | T_DATA | U_DATA ),
.bperms = ( R_META | W_META | R_DATA | W_DATA | T_DATA | U_DATA ),

.dirty_pack_percent = 0,
.dirty_pack_threshold = 75,

.quota_space = -1, /* no limit */
.quota_names = -1, /* no limit */

.shard_path = NULL,
.shard_count = 0,
};
push_namespace(&ns_dummy, find_repo_by_name("sproxyd_28"));


// free-for-all
ns_dummy = (MarFS_Namespace) {
.name = "test",
.mnt_path = "/test", // "<mnt_top>/test" comes here

.md_path = "/gpfs/fs1/test/mdfs",
.fsinfo_path = "/gpfs/fs1/test/fsinfo", /* a file */
.trash_md_path = "/gpfs/fs1/trash", // NOT NEC IN THE SAME FILESET!

.iperms = ( R_META | W_META | R_DATA | W_DATA | T_DATA | U_DATA ),
.bperms = ( R_META | W_META | R_DATA | W_DATA | T_DATA | U_DATA ),

.dirty_pack_percent = 0,
.dirty_pack_threshold = 75,

.quota_space = -1, /* no limit */
.quota_names = -1, /* no limit */

.shard_path = NULL,
.shard_count = 0,
};
push_namespace(&ns_dummy, find_repo_by_name("sproxyd_28"));
push_namespace(&ns_dummy, find_repo_by_name("proxy"));


// EMC ECS install (with S3)
Expand All @@ -505,31 +390,7 @@ int read_config(const char* config_fname) {
.shard_path = NULL,
.shard_count = 0,
};
push_namespace(&ns_dummy, find_repo_by_name("emcS3_00"));


// // jti testing on machine without GPFS
// ns_dummy = (MarFS_Namespace) {
// .name = "xfs",
// .mnt_path = "/xfs", // "<mnt_top>/xfs" comes here
//
// .md_path = "/mnt/xfs/jti/filesys/mdfs/test00",
// .trash_md_path = "/mnt/xfs/jti/filesys/trash/test00",
// .fsinfo_path = "/mnt/xfs/jti/filesys/fsinfo/test00",
//
// .iperms = ( R_META | W_META | R_DATA | W_DATA | T_DATA | U_DATA ),
// .bperms = ( R_META | W_META | R_DATA | W_DATA | T_DATA | U_DATA ),
//
// .dirty_pack_percent = 0,
// .dirty_pack_threshold = 75,
//
// .quota_space = (1024L * 1024 * 1024), /* 1 GB of data */
// .quota_names = 32, /* 32 names */
//
// .shard_path = NULL,
// .shard_count = 0,
// };
// push_namespace(&ns_dummy, find_repo_by_name("sproxyd_jti"));
push_namespace(&ns_dummy, find_repo_by_name("emc_s3"));


// jti testing on machine without GPFS
Expand All @@ -553,8 +414,7 @@ int read_config(const char* config_fname) {
.shard_path = NULL,
.shard_count = 0,
};
// push_namespace(&ns_dummy, find_repo_by_name("sproxyd_2k"));
push_namespace(&ns_dummy, find_repo_by_name("sproxyd_jti"));
push_namespace(&ns_dummy, find_repo_by_name("proxy"));


#ifdef TBD
Expand Down Expand Up @@ -584,8 +444,6 @@ int read_config(const char* config_fname) {





// "root" is a special path
//
// NOTE: find_namespace_by_path() will only return this namespace if its
Expand Down Expand Up @@ -749,6 +607,23 @@ MarFS_Repo* find_repo_by_name(const char* repo_name) {
return NULL;
}

MarFS_Repo* find_repo_by_range (MarFS_Namespace* ns,
size_t file_size) {
RangeList* range_list;

if (ns) {
for (range_list=ns->range_list; range_list; range_list=range_list->next) {

if ( (file_size >= range_list->min)
&& ((file_size <= range_list->max)
|| (range_list->max == -1))) {

return range_list->repo;
}
}
}
return NULL;
}

// Let others traverse repos, without knowing how they are stored
RepoIterator repo_iterator() {
Expand Down
8 changes: 8 additions & 0 deletions fuse/src/marfs_base_static_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ typedef struct MarFS_Repo {
const char* name; // (logical) name for this repo
const char* host; // e.g. "10.140.0.15:9020"

size_t host_len;
uint8_t host_offset; // for round-robin within a repo
uint8_t host_count;

// RepoFlagsType flags;
MarFS_Bool ssl;
MarFS_Bool update_in_place; // repo allows overwriting parts of data?
Expand Down Expand Up @@ -408,6 +412,10 @@ extern MarFS_Repo* find_repo(MarFS_Namespace* ns,
int interactive_write); // bool
extern MarFS_Repo* find_repo_by_name(const char* name);

extern MarFS_Repo* find_repo_by_range (MarFS_Namespace* namespacePtr,
size_t file_size );



// --- support for traversing repos (without knowing how they are stored)
//
Expand Down

0 comments on commit b7adc35

Please sign in to comment.