Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

Commit

Permalink
fixed conflicts for merging
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio Cacciari committed Jul 10, 2017
2 parents 3d3df26 + 4ad7d10 commit 5e20220
Show file tree
Hide file tree
Showing 15 changed files with 842 additions and 307 deletions.
440 changes: 323 additions & 117 deletions cmd/epicclient2.py

Large diffs are not rendered by default.

38 changes: 25 additions & 13 deletions install.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
*** Installation ***
*** Installation/Upgrade ***

The following describes the procedure to enable B2SAFE release-3.x.y
The following describes the procedure to enable B2SAFE release-4.x.y

NOTE: iRODS is running as a normal user process. NOT as root. The package can
be build by any user. During installation of the package it will use:
"/etc/irods/service_account.config" to set the ownership of the files.
NOTE: iRODS needs to be installed AND configured before installing/upgrading B2SAFE


It works as follows:
Expand All @@ -13,32 +14,41 @@ It works as follows:
- go to the directory where the packaging files are:
$ cd B2SAFE-core/packaging

* RPM *
* RPM creation, installation/upgrade *

- create package:
$ ./create_rpm_package.sh
INSTALLATION
- login as root and install package:
# rpm -ivh /home/irods/rpmbuild/RPMS/noarch/irods-eudat-b2safe-4.0-0.noarch.rpm
Preparing... ########################################### [100%]
1:irods-eudat-b2safe ########################################### [100%]
UPGRADE
- login as root and upgrade package:
# rpm -Uvh /home/irods/rpmbuild/RPMS/noarch/irods-eudat-b2safe-4.0-0.noarch.rpm
Preparing... ########################################### [100%]
1:irods-eudat-b2safe ########################################### [100%]

* DEB *
* DEB creation, installation/upgrade *

- create package:
$ ./create_deb_package.sh
- login as root or use sudo to install package:
$ sudo dpkg -i /home/irods/debbuild/irods-eudat-b2safe_3.0-0.deb
$ sudo dpkg -i /home/irods/debbuild/irods-eudat-b2safe_4.0-0.deb
Selecting previously unselected package irods-eudat-b2safe.
(Reading database ... .... files and directories currently installed.)
Preparing to unpack .../irods-eudat-b2safe_3.0-0.deb ...
Unpacking irods-eudat-b2safe (3.0-0) ...
Setting up irods-eudat-b2safe (3.0-0) ...
Preparing to unpack .../irods-eudat-b2safe_4.0-0.deb ...
Unpacking irods-eudat-b2safe (4.0-0) ...
Setting up irods-eudat-b2safe (4.0-0) ...


After installation/upgrade actions. Always to do! Even after an upgrade.

The package b2safe has been installed in /opt/eudat/b2safe.
To install/configure it in iRODS do following as the user who runs iRODS :

# update install.conf with correct parameters with your favorite editor
# update install.conf with correct parameters with your favorite editor. See
the NOTE below for parameters.
sudo vi /opt/eudat/b2safe/packaging/install.conf

# install/configure it as the user who runs iRODS
Expand All @@ -47,12 +57,12 @@ sudo su - $IRODS_SERVICE_ACCOUNT_NAME -s "/bin/bash" -c "cd /opt/eudat/b2safe/pa



NOTE: following need to be updated/added in "/opt/eudat/b2safe/packaging/install.conf":
NOTE: following needs to be updated/added in "/opt/eudat/b2safe/packaging/install.conf":
- DEFAULT_RESOURCE
- SERVER_ID
- BASE_URI (needed for epicclient)
- USERNAME (needed for epicclient)
- PREFIX (needed for epicclient)
- BASE_URI (needed for old epicclient) (OBSOLETE, so make it a comment)
- USERNAME (needed for old epicclient) (OBSOLETE, so make it a comment)
- PREFIX (needed for old epicclient) (OBSOLETE, so make it a comment)
- HANDLE_SERVER_URL (needed for epicclient2)
- PRIVATE_KEY (needed for epicclient2)
- CERTIFICATE_ONLY (needed for epicclient2)
Expand All @@ -69,9 +79,11 @@ NOTE: following need to be updated/added in "/opt/eudat/b2safe/packaging/install
$ cd /opt/eudat/b2safe/cmd
$ ./authZmanager.py -h
$ ./epicclient.py --help
$ ./epicclient2.py --help
$ ./logmanager.py -h
$ ./messageManager.py -h
$ ./metadataManager.py -h
$ ./timeconvert.py epoch_to_iso8601 2000000

Try to install missing packages with the standard package manager like apt, yum, zypper etc.
If packages are not within the standards use pip and install the missing packages with pip.
Expand Down
23 changes: 19 additions & 4 deletions packaging/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ check_epicclient2_config() {
echo "we will use the old epicclient"
EPICCLIENT2=false
else
echo "please add the following parameters to the file: ${INSTALL_CONFIG} and rerun the procedure\""
BASENAME=$(basename $INSTALL_CONFIG)
echo "Please add the following parameters to the file: \"${B2SAFE_PACKAGE_DIR}/packaging/${BASENAME}\""
echo "Update where necessary and rerun the procedure"
echo ""
echo "HANDLE_SERVER_URL=\"https://epic3.storage.surfsara.nl:8001\""
echo "PRIVATE_KEY=\"/path/prefix_suffix_index_privkey.pem\""
echo "CERTIFICATE_ONLY=\"/path/prefix_suffix_index_certificate_only.pem\""
Expand Down Expand Up @@ -267,13 +270,25 @@ update_server_config_json() {
fi
# put json file in a single string so it easier to process.
EUDAT_SERVER_CONFIG_JSON_STRING=`awk 1 ORS=' ' ${EUDAT_SERVER_CONFIG} | sed 's/ //g'`
JSON_RULESET=`echo $EUDAT_SERVER_CONFIG_JSON_STRING | sed 's/.*re_rulebase_set":/re_rulebase_set":/' | sed 's/}].*$/}]/'`
# append rules..
JSON_RULESET=`echo $EUDAT_SERVER_CONFIG_JSON_STRING | sed 's/.*re_rulebase_set":/re_rulebase_set":/ ; s/].*$/]/'`
# check for iRODS 4.2.1 and higher because of new format.
IRODS_SERVER_JSON_CONFIG_FORMAT_2='false'
echo $JSON_RULESET | grep -e "\"filename\"" > /dev/null
if [ $? -eq 1 ]
then
IRODS_SERVER_JSON_CONFIG_FORMAT_2='true'
fi
# create a rule working set..
JSON_RULESET_WORK=`echo $JSON_RULESET | sed 's/]//'`
EUDAT_RULEFILES=`echo $EUDAT_RULEFILES | sed 's/,/ /g'`
for file in $EUDAT_RULEFILES
do
JSON_RULESET_WORK+=",{\"filename\":\"$file\"}"
if [ "${IRODS_SERVER_JSON_CONFIG_FORMAT_2}" == "false" ]
then
JSON_RULESET_WORK+=",{\"filename\":\"$file\"}"
else
JSON_RULESET_WORK+=",\"$file\""
fi
done
JSON_RULESET_WORK+="]"
# substitute the new string for the old string
Expand Down
5 changes: 3 additions & 2 deletions packaging/irods-eudat-b2safe.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BuildArch: noarch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

#BuildRequires:
Requires: irods-icat or irods-server
#Requires: irods-icat or irods-server

%define _whoami %(whoami)
%define _b2safehomepackaging %(pwd)
Expand Down Expand Up @@ -139,7 +139,6 @@ CERTIFICATE_ONLY=</path/prefix_suffix_index_certificate_only.pem>
PREFIX=<ZZZ>
HANDLEOWNER="200:0.NA/\$PREFIX"
REVERSELOOKUP_USERNAME=<ZZZ>
#REVERSELOOKUP_PASSWORD=<Password>
HTTPS_VERIFY="True"
#
# users for msiexec command
Expand Down Expand Up @@ -194,6 +193,8 @@ fi


%changelog
* Wed Apr 18 2017 Robert Verkerk <[email protected]> 4.0.0
- update for better info. Remove requires. iRODS can be in 2 different packages.
* Fri Nov 20 2015 Robert Verkerk <[email protected]> 3.0.0
- set owner of files during installation of rpm.
* Fri Oct 23 2015 Robert Verkerk <[email protected]> 3.0.0
Expand Down
6 changes: 3 additions & 3 deletions rules/eudatCreatePid.r
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ eudatCreatePID{
msiDataObjClose(*S_FD, *status2);
writeLine("stdout", "");
# PID creation
# with PID registration in iCAT (4th argument "true")
# EUDATCreatePID(*parent_pid, *source, *ror, "true", *newPID);
EUDATCreatePID("None", "*home/test_data.txt", "None", "true", *newPID);

# EUDATCreatePID(*parent_pid, *source, *ror, *fio, *fixed, *newPID);
EUDATCreatePID("None", "*home/test_data.txt", "None", "None", "false", *newPID);
writeLine("stdout", "The Object *home/test_data.txt has PID = *newPID");

EUDATePIDremove("*home/test_data.txt", "true");
Expand Down
4 changes: 2 additions & 2 deletions scripts/authN_and_authZ/remote_users_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def main(self):
help='the syncronization target')
parser_group.add_argument('group', help='the target group (or project)')
parser_group.add_argument('-s', '--subgroups', dest='subgroups',
default='', help='the target sub-groups')
required=True, help='the target sub-groups')

_args = parser.parse_args()

Expand All @@ -65,7 +65,7 @@ def main(self):
if (_args.subgroups is not None) and (len(_args.subgroups)) > 0:
subgroups = [n.strip() for n in _args.subgroups.split(",")]
else:
subgroups = None
subgroups = None

ll = {'INFO': logging.INFO, 'DEBUG': logging.DEBUG, \
'ERROR': logging.ERROR, 'WARNING': logging.WARNING}
Expand Down
15 changes: 0 additions & 15 deletions scripts/authN_and_authZ/user_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,20 +153,6 @@ def synchronize(self, dryrun):
dn_map = self._parseDNMap()

# if log level is equal to DEBUG (level 10)
<<<<<<< HEAD
pp = pprint.PrettyPrinter(indent=4)
logger.debug("###### irods users ######")
logger.debug(pp.pformat(irods_users))
logger.debug("###### irods groups ######")
logger.debug(pp.pformat(irods_projects))
logger.debug("### groups/projects imported from a local source ###")
logger.debug(pp.pformat(local_projects))
logger.debug("### groups/projects imported from a remote source ###")
logger.debug(pp.pformat(remote_projects))
logger.debug("### DNs imported from a remote source ###")
logger.debug(pp.pformat(dn_map))

=======
# if (logger.getEffectiveLevel() == 10):
# pp = pprint.PrettyPrinter(indent=4)
# print("###### irods users ######")
Expand All @@ -180,7 +166,6 @@ def synchronize(self, dryrun):
# print("### DNs imported from a remote source ###")
# pp.pprint(dn_map)

>>>>>>> master
if not self.conf.local_authoritative:
logger.debug("local source is not authoritative")
if local_projects is None:
Expand Down
Loading

0 comments on commit 5e20220

Please sign in to comment.