Skip to content

Commit

Permalink
version 2.04.05
Browse files Browse the repository at this point in the history
  • Loading branch information
ppawliczek committed Dec 28, 2016
1 parent 578c10b commit aeba69d
Show file tree
Hide file tree
Showing 49 changed files with 1,397 additions and 976 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Genboree

Main Genboree installation is available online at http://genboree.org. This package contains sources of base components from this installation. This version of Genboree<sup>TM</sup> Server includes Genboree Workbench, GenboreeKB and Redmine with several plugins. This version can be installed on a computer with a 64-bit Linux operating system (access to root account is required).
The main Genboree installation is available online at http://genboree.org. This package contains sources of base components from this installation.
This version of Genboree<sup>TM</sup> Server includes Genboree Workbench, GenboreeKB and Redmine with several plugins.
This version can be installed on a computer with a 64-bit Linux operating system (access to root account is required).

GitHub repository contains all sources and scripts from Genboree. However Genboree requires dozens of dependencies that are not included in this repository. The best way to install Genboree is to use the installation package that can be downloaded from ftp://genboree.org/software/genboree/genboree-2.05.01.tar. There is an installation instruction in the docs directory.
This GitHub repository contains all sources and scripts from Genboree.
However Genboree requires dozens of dependencies that are not included in this repository.
The best way to install Genboree is to use the installation package that can be downloaded from [Releases page](https://github.com/BRL-BCM/genboree/releases).
There is an installation instruction in the docs directory.
3 changes: 0 additions & 3 deletions scripts/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ cp ../src/license.txt ../src/agpl-3.0.txt ${DIR_TARGET}
./build_data.sh "$@"
./build_final.sh "$@"
./build_redmine.sh "$@"
# ---- remove .svn directories
find ${DIR_TARGET} -type d -name .svn -exec rm -rf {} \; || true
find ${DIR_DATA} -type d -name .svn -exec rm -rf {} \; || true
# ---- Make a final package
mv ${DIR_TARGET} ./local
mv ${DIR_DATA} ./data
Expand Down
2 changes: 0 additions & 2 deletions scripts/conf_runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ export TMPDIR=${DIR_TARGET}/tmp

# svn://histidine.brl.bcmd.bcm.edu/brl-repo/PATCH_NOTES/genboree/2014-11-12.contentGen
export OMIM_API_KEY=VKGiMHRGQwe3m18OEED1Yw
# API key for bioPortal
export BIOPORTAL_API_KEY=e750aaca-98af-49fa-8349-82caf2ce4f5b

# svn://histidine.brl.bcmd.bcm.edu/brl-repo/PATCH_NOTES/genboree/2015-08-13.snifferMove
export SNIFFER_CONF_FILE=${DIR_TARGET}/conf/snifferFormatInfo.json
Expand Down
2 changes: 1 addition & 1 deletion src/conf/genboree.config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -341,4 +341,4 @@ gbApiExtConfsDir=/usr/local/brl/local/conf/apiExtensions
FTPsmRNAPipelineReadCountCategories=/usr/local/brl/local/conf/FTPsmRNAPipeline/FTPsmRNAPipelineReadCountCategories.conf

# required by Pathogenicity Calculator 2.6
gridConfV2_6Header=/usr/local/brl/local/apache/htdocs/clingenInference/V2.6/includes/header.incl
calcBaseDir=/usr/local/brl/local/apache/htdocs/
20 changes: 0 additions & 20 deletions src/etc/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -332,26 +332,6 @@ http {
break ;
}

# Redmine - Upload Request - KbDocs File Upload
location = /redmine/genboree_kbs/collection/uploaddocs {
client_body_buffer_size 8m ;
client_body_temp_path /usr/local/brl/local/tmp/nginx/client_file_upload 1 2 3 ; # use 3 levels to organize temp files
client_body_in_file_only on ;
client_max_body_size 100000m ; # 100gb file upload max, for example
proxy_pass_request_headers on ;
include /usr/local/brl/local/etc/nginx/proxy_set_headers.conf ;
proxy_set_header X-GB-Uploaded-File $request_body_file ;
proxy_set_header X-GB-Uploaded-Content-Type $content_type ;
proxy_set_header X-GB-Saved-Uploaded true ;
proxy_set_header Content-Type text/plain ;
proxy_set_header Connection close;
proxy_hide_header Etag ;
proxy_set_body "${request_body_file} ; ${content_type}" ;
proxy_pass http://thin_redmine ;
proxy_redirect off ;
break ;
}

# Redmine - Upload Request - DB File Upload
location = /redmine/genboree_kbs/doc/uploadfile {
client_body_buffer_size 8m ;
Expand Down
1 change: 0 additions & 1 deletion src/etc/nginx/proxy_set_headers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# - Can use this include to reset the standard ones.
proxy_set_header Host $host ;
proxy_set_header X-Real-IP $remote_addr ;
proxy_set_header X-Coming-From-IP $remote_addr ;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
proxy_set_header X-Proxy-Host $proxy_host ;
proxy_set_header X-Proxy-Port $proxy_port ;
Expand Down
99 changes: 5 additions & 94 deletions src/home/lib/genboreeTools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,6 @@ def genboree_add_kb(group, kb, description = nil)
api_put(kbUri, payload)
end

def genboree_delete_kb(group, kb)
kbUri = '/REST/v1/grp/' + CGI::escape(group) + '/kb/' + CGI::escape(kb)
api_delete(kbUri)
end

# check if kb exists
def genboree_kb_exists(group, kb)
return api_object_exists('/REST/v1/grp/' + CGI::escape(group) + '/kb/' + CGI::escape(kb))
Expand All @@ -255,33 +250,20 @@ def genboree_set_kb_public(group, kb)
# Construct unlock record for the KB we want to unlock
unlockRec = { "url" => kbUrl, "public" => true }
# Sent PUT request
api_put("/REST/v1/grp/#{CGI::escape(group)}/unlockedResources", [unlockRec].to_json)
api_put("/REST/v1/grp/#{group}/unlockedResources", [unlockRec].to_json)
end

# assign user to group (change role, if user already assigned)
def genboree_assign_user_to_group_as_subscriber(user, group)
api_put("/REST/v1/grp/#{CGI::escape(group)}/usr/#{CGI::escape(user)}/role", {"role"=>"subscriber", "permissionBits"=>""})
api_put("/REST/v1/grp/#{group}/usr/#{user}/role", {"role"=>"subscriber", "permissionBits"=>""})
end
def genboree_assign_user_to_group_as_author(user, group)
api_put("/REST/v1/grp/#{CGI::escape(group)}/usr/#{CGI::escape(user)}/role", {"role"=>"author", "permissionBits"=>""})
end

def genboree_kb_add_collection(group, kb, collection, model)
uri = "/REST/v1/grp/#{CGI::escape(group)}/kb/#{CGI::escape(kb)}/coll/#{CGI::escape(collection)}/model"
model = model.to_json if model.is_a?(Hash)
api_put(uri, model)
end

def genboree_kb_add_transform(group, kb, transformDefinition)
transformDefinition = JSON.parse(transformDefinition) if transformDefinition.is_a?(String)
name = transformDefinition['Transformation']['value']
uri = "/REST/v1/grp/#{CGI::escape(group)}/kb/#{CGI::escape(kb)}/transform/#{CGI::escape(name)}"
api_put(uri, transformDefinition.to_json)
api_put("/REST/v1/grp/#{group}/usr/#{user}/role", {"role"=>"author", "permissionBits"=>""})
end

# load documents to KB collections
def genboree_kb_add_documents(group, kb, collection, documents, autoAdjustId=true, substitutions=Hash.new, chunk_size=128)
uri = "/REST/v1/grp/#{CGI::escape(group)}/kb/#{CGI::escape(kb)}/coll/#{CGI::escape(collection)}/docs"
uri = "/REST/v1/grp/#{group}/kb/#{kb}/coll/#{collection}/docs"
uri += "?autoAdjust=true" if autoAdjustId
while documents.size > 0
payload = { "data" => documents.shift(chunk_size) }
Expand All @@ -294,7 +276,7 @@ def genboree_kb_add_documents(group, kb, collection, documents, autoAdjustId=tru
end

def genboree_kb_add_documents_from_file(group, kb, collection, filename, autoAdjustId=true, substitutions=Hash.new, chunk_size=128)
uri = "/REST/v1/grp/#{CGI::escape(group)}/kb/#{CGI::escape(kb)}/coll/#{CGI::escape(collection)}/docs"
uri = "/REST/v1/grp/#{group}/kb/#{kb}/coll/#{collection}/docs"
uri += "?autoAdjust=true" if autoAdjustId
api_put_from_file_in_chunks(uri, filename, substitutions, chunk_size)
end
Expand Down Expand Up @@ -333,28 +315,6 @@ def redmine_assign_user_to_project(user_login, project_identifier, roles_names)
redmine_api_post("/projects/#{project_identifier}/memberships.json", '{"membership":{"user_id":' + "#{user_id}" + ',"role_ids":' + roles_ids.to_json + '}}')
end

# set configuration of genboree_kb project
def redmine_configure_project_genboree_kb(project_identifier, genboree_group, kb_name)
# find project id
resp = redmine_api_get("/projects/#{project_identifier}.json")
id = resp["project"]["id"]
raise "Cannot find project with identifier: #{project_identifier}" if id.nil?
# set record's fields
fields = Hash.new
fields['project_id'] = id
fields['name'] = "#{kb_name}"
fields['gbGroup'] = "#{genboree_group}"
fields['gbHost'] = 'localhost'
# check if the record exists and rub insert or update
sql = "SELECT COUNT(1) AS count FROM genboree_kbs WHERE project_id=#{id}"
if runSqlStatement_redmine(sql).first['count'].to_i == 0
sql = sql_insert('genboree_kbs', fields)
else
sql = sql_update('genboree_kbs', fields) + " WHERE project_id=#{id}"
end
runSqlStatement_redmine(sql)
end

# set configuration of genboree_ac project
def redmine_configure_project_genboree_ac(project_identifier, ac_genboree_group, ac_kb_name, orphanet_kb_name,
release_kb_name = nil, header_include_file = nil, footer_include_file = nil)
Expand Down Expand Up @@ -387,55 +347,6 @@ def redmine_configure_project_genboree_ac(project_identifier, ac_genboree_group,
runSqlStatement_redmine(sql)
end

# set configuration of genboree_exrna_at project
def redmine_configure_project_genboree_exrna_at(project_identifier, genboree_group, kb_name, home_page = "/redmine/projects/#{project_identifier}/exat")
# find project id
resp = redmine_api_get("/projects/#{project_identifier}.json")
id = resp["project"]["id"]
raise "Cannot find project with identifier: #{project_identifier}" if id.nil?
# set record's fields
fields = Hash.new
fields['project_id'] = id
fields['gbHost'] = 'localhost'
fields['gbGroup'] = genboree_group
fields['gbKb'] = kb_name
fields['appLabel'] = nil
fields['useRedmineLayout'] = 1
fields['headerIncludeFileLocation'] = nil
fields['footerIncludeFileLocation'] = nil
fields['analysesColl'] = 'Analyses'
fields['biosamplesColl'] = 'Biosamples'
fields['donorsColl'] = 'Donors'
fields['experimentsColl'] = 'Experiments'
fields['jobsColl'] = 'Jobs'
fields['resultFilesColl'] = 'Result Files'
fields['runsColl'] = 'Runs'
fields['studiesColl'] = 'Studies'
fields['submissionsColl'] = 'Submissions'
fields['updateData'] = 0
fields['newsFile'] = ''
fields['contactTo'] = ''
fields['contactBccs'] = ''
fields['jobHost'] = 'localhost'
fields['toolUsageHost'] = ''
fields['toolUsageGrp'] = ''
fields['toolUsageKb'] = ''
fields['toolUsageColl'] = ''
fields['toolUsageView'] = ''
fields['privateSubmitters'] = ''
fields['homePageUrl'] = home_page
fields['infoFlashHtml'] = ''
fields['prevVersions'] = ''
# check if the record exists and rub insert or update
sql = "SELECT COUNT(1) AS count FROM genboree_exrna_ats WHERE project_id=#{id}"
if runSqlStatement_redmine(sql).first['count'].to_i == 0
sql = sql_insert('genboree_exrna_ats', fields)
else
sql = sql_update('genboree_exrna_ats', fields) + " WHERE project_id=#{id}"
end
runSqlStatement_redmine(sql)
end

=begin
class KbCollection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ module BeforeFiltersHelper
# BEFORE_FILTERS - useful before_filter methods for your controller
# ----------------------------------------------------------------

# Popular the @urlMount variable with this Redmine's mount point (first dir in path)
def getKbMount()
@redmineMount = @kbMount = @urlMount = RedmineApp::Application.routes.default_scope[:path].to_s.gsub(/'/, "\\\\'").gsub(/\n/, ' ') ;
$stderr.debugPuts(__FILE__, __method__, 'DEBUG', "generic getKbMount has set @redmineMount, @kbMount, @urlMount to #{@redmineMount.inspect}")
end
alias_method(:redmineMount, :getKbMount)
alias_method(:getUrlMount, :getUrlMount)

# Authorize the user for the requested action. In addition to regular checks, allow if project is public.
# Always allow members through
def authorize_with_public_project(ctrl = params[:controller], action = params[:action], global = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,13 @@ module BeforeFiltersHelper

# Retrieve the project-specific plugin settings record.
# @note Assume the Controller defines PLUGIN_SETTINGS_MODEL_CLASS.
# @param [Project] project Optional. Defaults to @project when used within controller. To support settings
# must hand in Project object.
# @param [Class] settingsClass Optional. Not needed in controller, since will use PLUGIN_SETTINGS_MODEL_CLASS defined in your controller.
# To support settings must hand in settings class/model.
# @return [Object] An instance of the plugin model settings for the current project
# with access to any project-specific settings for this plugin.
def plugin_proj_settings(project=@project, settingsClass=nil)
if(settingsClass.nil?) # then within controller _instance_ and can get class from controller
settingsClass = ( defined?(self.class::PLUGIN_SETTINGS_MODEL_CLASS) ? self.class::PLUGIN_SETTINGS_MODEL_CLASS : nil )
end
def plugin_proj_settings()
@pluginProjSettings = nil
if(settingsClass)
if(defined?(self.class::PLUGIN_SETTINGS_MODEL_CLASS))
#$stderr.debugPuts(__FILE__, __method__, '++++++ DEBUG', "Have model class: #{self.class::PLUGIN_SETTINGS_MODEL_CLASS.inspect}")
@pluginProjSettings = settingsClass.find_by_project_id(project) # rescue nil
else
$stderr.debugPuts(__FILE__, __method__, 'WARNING', "Either this *plugin* controller (#{self.class.inspect}) does not define PLUGIN_SETTINGS_MODEL_CLASS or we're not in a controller / instance context (e.g. project-settings) and the appropriate settings class was not passed in.")
@pluginProjSettings = self.class::PLUGIN_SETTINGS_MODEL_CLASS.find_by_project_id(@project) # rescue nil
end
@pluginProjSettings
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@ def apiPut(rsrcPath, payload, fieldMap={})
retVal = { :respObj => '', :status => 500}
# Add standard field info to fieldMap IFF not provided
gbAuthHelper = GbApi::GbAuthHelper.new()
if(@redmineProject.nil?)
login, pass = gbAuthHelper.authPairForUserAndHost(@reqHost, @redmineUser)
#$stderr.debugPuts(__FILE__, __method__, "DEBUG", "Login Pass from authPairForUserAndHost")
else
login, pass = gbAuthHelper.authPairForUserAndHostInProjContext(@redmineProject, @reqHost, @redmineUser)
end
login, pass = gbAuthHelper.authPairForUserAndHostInProjContext(@redmineProject, @reqHost, @redmineUser)
if(login and pass)
apiCaller = BRL::REST::ApiCaller.new(@reqHost, rsrcPath, login, pass)
apiCaller.put( fieldMap, payload )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
module GbTools
# a simple class to submit Genboree tool jobs
class GbToolSubmitter
def initialize(env, jobHost, redminePrj)
raise ArgumentError, "HOST_ERROR: The rack environment - cannot be #{env.class} (nil or empty)" if(env.nil? or env.empty?)
raise ArgumentError, "HOST_ERROR: The jobhost - #{jobHost.inspect} cannot be #{jobHost.class} (nil or empty)" if(jobHost.nil? or jobHost.empty?)

@apiReq = GbApi::JsonAsyncApiRequester.new(env, jobHost, redminePrj)
def initialize(jobHost, rmProject)
@jobHost = jobHost
@redminePrj = rmProject
end

# submits the tool to the tool job rest resource path
Expand All @@ -15,19 +13,11 @@ def initialize(env, jobHost, redminePrj)
# @todo apiPut to be replaced by the async request
def submit(toolIdStr, jobConf)
submitResp = {:respObj => nil, :status => nil}
rsrcPath = "/REST/v1/genboree/tool/{toolIdStr}/job"
fieldMap = {:toolIdStr => toolIdStr}
@apiReq.bodyFinish {
headers = @apiReq.respHeaders
status = @apiReq.respStatus
headers['Content-Type'] = "text/plain"
$stderr.debugPuts(__FILE__, __method__, 'DEBUG', "@apiReq ------- #{@apiReq.respBody.inspect}")
@apiReq.sendToClient(status, headers, JSON.generate(@apiReq.respBody))
}
$stderr.debugPuts(__FILE__, __method__, 'DEBUG', "rsrcPath ------- #{rsrcPath.inspect}")
$stderr.debugPuts(__FILE__, __method__, 'DEBUG', "fieldMap------- #{fieldMap.inspect}")
@apiReq.put(rsrcPath, fieldMap, jobConf.to_json)

rsrcPath = "/REST/v1/genboree/tool/{toolIdStr}/job"
fieldMap = {:toolIdStr => toolIdStr}
syncReq = GbApi::SyncApiRequester.new(@jobHost, @redminePrj)
submitResp = syncReq.apiPut(rsrcPath, JSON.generate(jobConf), fieldMap)
return submitResp
end


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ def index()
@showModelVersionsGrid = ( params['showModelVersionsGrid'] and params['showModelVersionsGrid'] == 'true' ) ? true : false
@createNewDoc = ( params['createNewDoc'] and params['createNewDoc'] == 'true' ) ? true : false
@createNewDocWithTemplate = ( params['createNewDocWithTemplate'] and params['createNewDocWithTemplate'] == 'true' ) ? true : false
@createNewDocWithQuestionnaire = ( params['createNewDocWithQuestionnaire'] and params['createNewDocWithQuestionnaire'] == 'true' ) ? true : false
@templateId = params['templateId'] || ''
@questionnaireId = params['questionnaireId'] || ''
@kbMount = RedmineApp::Application.routes.default_scope[:path]
# If the page is being accessed without logging in, redirect user to login page
# If the original URL was pointing to a particular document and/or collection,
Expand All @@ -67,6 +65,7 @@ def index()
end



def getCollList()
apiResult = apiGet( "/REST/v1/grp/{grp}/kb/{kb}" )
unless(apiResult[:respObj] and apiResult[:respObj]['data'])
Expand Down Expand Up @@ -172,9 +171,7 @@ def constructBackUrl(projectId)
backUrl << "&showViewGrid=true" if(@showViewGrid)
backUrl << "&createNewDoc=true" if(@createNewDoc)
backUrl << "&createNewDocWithTemplate=true" if(@createNewDocWithTemplate)
backUrl << "&createNewDocWithQuestionnaire=true" if(@createNewDocWithQuestionnaire)
backUrl << "&templateId=#{CGI.escape(@templateId)}" if(@templateId != "")
backUrl << "&questionnaireId=#{CGI.escape(@questionnaireId)}" if(@questionnaireId != "")
return backUrl
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def create

def update
kb = GenboreeKb.find_by_project_id(params['project_id'])
@genboreeKb = kb
kb.name = params['name']
kb.description = params['description']
kb.gbGroup = params['gbGroup']
Expand Down
Loading

0 comments on commit aeba69d

Please sign in to comment.