Giter VIP home page Giter VIP logo

fcrepo_wrapper's Introduction

FcrepoWrapper

Wrap any task with a Fcrepo instance:

FcrepoWrapper.wrap do |fedora_repo|
  # Something that requires Fcrepo
end

Configuration Options

Command Line

To see a list of valid options when using fcrepo_wrapper to launch an Fcrepo instance from the command line:

$ fcrepo_wrapper -h

Ruby

FcrepoWrapper.wrap( port: 8983, verbose: true, managed: true )

Configuration file

FcrepoWrapper can read configuration options from a YAML configuration file. By default, it looks for configuration files at .fcrepo_wrapper and ~/.fcrepo_wrapper.

You can also specify a configuration file when launching from the command line as follows:

$ fcrepo_wrapper -config <path_to_config_file>

Valid ruby and YAML options

Option Description
download_dir Local path for storing the downloaded jar & md5 file
env (Hash)
fcrepo_home_dir Directory to store fedora repository data files
fedora_options (Hash)
ignore_md5sum (Boolean) suppress checksum error messages
instance_dir Directory to store the fedora jar file
md5sum Path/URL to MD5 checksum
port Port to run Fedora on
url URL of the jar file to download
validate (Boolean) download a new md5 and (re-)validate the jar file? (default: true)
verbose (Boolean) return verbose info when running fcrepo commands (default: false)
version Fedora version to download and install
version_file Local path to store the currently installed version number

Cleaning your repository from the command line

To clean out data that is being stored in you FcrepoWrapper explicitly run:

$ fcrepo_wrapper <configuration options> clean

Note You must use the same configuration options on the clean command as you do on the run command to clean the correct instance.

fcrepo_wrapper's People

Contributors

awead avatar billdueber avatar carolyncole avatar cbeer avatar dazza-codes avatar jcoyne avatar mark-dce avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fcrepo_wrapper's Issues

Examples of configuration file (in yml) needed

I've been using fcrepo_wrapper (and solr_wrapper) for a while for development and testing. The documentation indicates the an "env" and "fedora_options" hashes can be used but I'm not sure how to construct the config.yml file to do so. Specifically, I'm looking for a way to configuration the modeshape options to do some testing with a SQL database for the object store. It would be nice to have a "full" example of a configuration file which showed how to set all of the available configuration options.

Fedora tries to start ActiveMQ when `no_jms: true`

ERROR 14:11:34.606 (BrokerService) Failed to start Apache ActiveMQ ([localhost, ID:Justins-MacBook-Pro-2.local-54368-1455048694466-0:1], {})
java.io.IOException: Transport Connector could not be registered in JMX: Failed to bind to server socket: tcp://0.0.0.0:61616?maximumConnections=1000&wireformat.maxFrameSize=104857600 due to: java.net.BindException: Address already in use

BUG: download progress bar exceeds max

This an error from a hyrax engine cart, but I think it's coming from fcrepo_wrapper:

$ bundle exec rake hydra:server
rake aborted!-4.7.1-jetty-console.jar: |===========================================================================================================  | 99% ( ETA: 00:00:00 )
ProgressBar::InvalidProgressError: You can't set the item's current value to be greater than the total.
/users/dlweber/.rbenv/versions/2.4.1/bin/bundle:22:in `load'
/users/dlweber/.rbenv/versions/2.4.1/bin/bundle:22:in `<main>'
Tasks: TOP => hydra:server
(See full trace by running task with --trace)

Do not clean the downloads

Current behavior:

$ ls -l ~/tmp/fcrepo_wrapper/
total 47M
-rw-r--r-- 1 dlweber users 47M May  5 13:04 fcrepo-webapp-4.7.1-jetty-console.jar
-rw-r--r-- 1 dlweber users  71 May  5 13:04 fcrepo-webapp-4.7.1-jetty-console.jar.md5

$ cat ~/.fcrepo_wrapper 
download_dir: /users/dlweber/tmp/fcrepo_wrapper

$ cat .fcrepo_wrapper 
port: 8984
enable_jms: false

$ fcrepo_wrapper clean
cleaning /tmp/fcrepo-webapp-4.7.1-jetty-console...

$ ls -l ~/tmp/fcrepo_wrapper/
total 0

Kernel#open is deprecated.

Starting Fedora 4.7.6 on port 8984 ...
/Users/scherztc/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/fcrepo_wrapper-0.9.0/lib/fcrepo_wrapper/downloader.rb:7: warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open.

Proposed Solution:

require 'open-uri'

URI.open(url,
         content_length_proc: ->(bytes) { pbar.total = bytes },
         progress_proc: ->(bytes) { pbar.progress = bytes }) do |io|
  IO.copy_stream(io, output)
end

This is necessary to run the ActiveMQ secure version of Fedora.

I am also stillon Hyrax 2.x and therefore stuck with ruby 2.7.8

Update README

The current options are not consistent with the README

$ fcrepo_wrapper -h
Usage: fcrepo_wrapper [options]
        --config FILE                Load configuration from a file
    -v, --[no-]verbose               Run verbosely
        --[no-]jms                   Run with[or witout] JMS
        --version VERSION            Specify a fcrepo version to download (default: 4.7.1)
    -p, --port PORT                  Specify the port fcrepo should run at (default: 8080)
    -i, --instance_directory DIR     Install/use fcrepo jar at the given directory
    -d, --fcrepo_home DIR            Store fcrepo at the given directory
    -h, --help                       Show these usage options

Commonly used command are:
   clean :     cleans all data from fedora based on configuration options
See 'fcrepo_wrapper COMMAND --help' for more information on a specific command.
$ cat .fcrepo_wrapper 
# Place any default configuration for solr_wrapper here
port: 8984
enable_jms: false
  • What is the enable_jms and --[no]jms option?

Maybe add links to relevant FCREPO docs? Maybe:

Stash the downloads?

Stash the downloads into a tmp folder for safe keeping, check the tmp folder for the downloads before downloading them again? (Perhaps just download the md5 and use it to verify the stash again if a double check is required.) This could save some time when using fcrepo_wrapper during transit-time development activities (commuting or flights or just anywhere with lousy network connections). e.g.

./tmp/fcrepo_wrapper/fcrepo-webapp-4.7.1-jetty-console.jar
./tmp/fcrepo_wrapper/fcrepo-webapp-4.7.1-jetty-console.jar.md5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.