
function install_plugin_artifacts {
    echo "Installing plugin resources"

    mkdir -p ${ARTIFACT_REPOSITORY_DIR}
    REPO_MANAGER_OPTIONS="--repo-dir-quota  1000000000"
    RUN_ARTIFACT_MANAGER="java -Dlog4j.configuration=file:${GOBY_DIR}/log4j.properties \
             -Djava.io.tmpdir=${TMPDIR} \
             -cp ${GOBY_DIR}/serverside-dependencies.jar:artifact-manager.jar \
             org.campagnelab.gobyweb.artifacts.ArtifactManager "

    ${RUN_ARTIFACT_MANAGER} \
            --ssh-requests  ${SGE_O_WORKDIR}/artifacts-install-requests.pb \
            --repository ${ARTIFACT_REPOSITORY_DIR} ${REPO_MANAGER_OPTIONS} \
            --install

    if [ $? != 0 ]; then
         ${QUEUE_WRITER} --tag ${TAG} --status ${JOB_PART_FAILED_STATUS} --description "Job failed: unable to install required software/data artifacts." --index ${CURRENT_PART} --job-type job
         exit 120
    fi
    echo "Expose environment variables for artifacts:"
    rm -f exports.sh
    ${RUN_ARTIFACT_MANAGER} \
        --repository ${ARTIFACT_REPOSITORY_DIR} ${REPO_MANAGER_OPTIONS} \
        --bash-exports --ssh-requests  ${SGE_O_WORKDIR}/artifacts-install-requests.pb \
        --output exports.sh

    cat exports.sh
    . exports.sh
    cp exports.sh ${TMPDIR}/
}

function install_plugin_artifacts {
    echo "Installing plugin resources"

    mkdir -p ${ARTIFACT_REPOSITORY_DIR}
    REPO_MANAGER_OPTIONS="--repo-dir-quota  1000000000"
    RUN_ARTIFACT_MANAGER="java -Dlog4j.configuration=file:${GOBY_DIR}/log4j.properties \
             -Djava.io.tmpdir=${TMPDIR} \
             -cp ${GOBY_DIR}/serverside-dependencies.jar:artifact-manager.jar \
             org.campagnelab.gobyweb.artifacts.ArtifactManager "

    ${RUN_ARTIFACT_MANAGER} \
            --ssh-requests  ${SGE_O_WORKDIR}/artifacts-install-requests.pb \
            --repository ${ARTIFACT_REPOSITORY_DIR} ${REPO_MANAGER_OPTIONS} \
            --install

    if [ $? != 0 ]; then
         ${QUEUE_WRITER} --tag ${TAG} --status ${JOB_PART_FAILED_STATUS} --description "Job failed: unable to install required software/data artifacts." --index 1 --job-type job
         exit 120
    fi
    echo "Expose environment variables for artifacts:"
    rm -f exports.sh
    ${RUN_ARTIFACT_MANAGER} \
        --repository ${ARTIFACT_REPOSITORY_DIR} ${REPO_MANAGER_OPTIONS} \
        --bash-exports --ssh-requests  ${SGE_O_WORKDIR}/artifacts-install-requests.pb \
        --output exports.sh

    cat exports.sh
    . exports.sh
    cp exports.sh ${TMPDIR}/
}
Set index for queue writer.
Set index for queue writer.

git-svn-id: 9019e3cb94a522c981194da839dc9955d4aaf999@34029 60cd2ccc-2b05-0410-9566-da273a940bff
