Search in sources :

Example 51 with AuthzToken

use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.

the class SampleEchoExperiment method registerGatewayProfile.

private void registerGatewayProfile() throws TException {
    GatewayResourceProfile gatewayResourceProfile = new GatewayResourceProfile();
    ComputeResourcePreference localhostResourcePreference = RegisterSampleApplicationsUtils.createComputeResourcePreference(localhostId, gatewayId, false, null, null, null, "/tmp");
    gatewayResourceProfile.setGatewayID(gatewayId);
    gatewayResourceProfile.addToComputeResourcePreferences(localhostResourcePreference);
    airavataClient.registerGatewayResourceProfile(new AuthzToken(""), gatewayResourceProfile);
}
Also used : ComputeResourcePreference(org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference) GatewayResourceProfile(org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile) AuthzToken(org.apache.airavata.model.security.AuthzToken)

Example 52 with AuthzToken

use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.

the class SampleEchoExperiment method createEchoExperiment.

private void createEchoExperiment() throws TException {
    Project project = new Project();
    project.setName("default-project");
    project.setOwner(userId);
    String projectId = airavataClient.createProject(new AuthzToken(""), gatewayId, project);
    ExperimentModel experimentModel = new ExperimentModel();
    experimentModel.setExperimentName("dummy-echo-experiment");
    experimentModel.setProjectId(projectId);
    experimentModel.setUserName(userId);
    experimentModel.setGatewayId(gatewayId);
    experimentModel.setExecutionId(echoInterfaceId);
    UserConfigurationDataModel userConfigurationDataModel = new UserConfigurationDataModel();
    ComputationalResourceSchedulingModel computationalResourceSchedulingModel = new ComputationalResourceSchedulingModel();
    computationalResourceSchedulingModel.setNodeCount(1);
    computationalResourceSchedulingModel.setTotalCPUCount(1);
    computationalResourceSchedulingModel.setTotalPhysicalMemory(512);
    computationalResourceSchedulingModel.setResourceHostId(localhostId);
    userConfigurationDataModel.setComputationalResourceScheduling(computationalResourceSchedulingModel);
    experimentModel.setUserConfigurationData(userConfigurationDataModel);
    List<InputDataObjectType> experimentInputs = new ArrayList<>();
    experimentInputs.add(RegisterSampleApplicationsUtils.createAppInput("Input_to_Echo", "Hello World", DataType.STRING, null, 1, true, true, false, "A test string to Echo", null));
    experimentModel.setExperimentInputs(experimentInputs);
    experimentModel.setExperimentOutputs(airavataClient.getApplicationOutputs(new AuthzToken(""), echoInterfaceId));
    echoExperimentId = airavataClient.createExperiment(new AuthzToken(""), gatewayId, experimentModel);
}
Also used : Project(org.apache.airavata.model.workspace.Project) UserConfigurationDataModel(org.apache.airavata.model.experiment.UserConfigurationDataModel) InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType) AuthzToken(org.apache.airavata.model.security.AuthzToken) ExperimentModel(org.apache.airavata.model.experiment.ExperimentModel) ArrayList(java.util.ArrayList) ComputationalResourceSchedulingModel(org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel)

Example 53 with AuthzToken

use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.

the class SampleEchoExperiment method registerEchoInterface.

private void registerEchoInterface() {
    try {
        System.out.println("#### Registering Echo Interface ####");
        List<String> appModules = new ArrayList<String>();
        appModules.add(echoModuleId);
        InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("Input_to_Echo", "Hello World", DataType.STRING, null, 1, true, true, false, "A test string to Echo", null);
        List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
        applicationInputs.add(input1);
        OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("Echoed_Output", "", DataType.STRING, true, false, null);
        List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
        applicationOutputs.add(output1);
        echoInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), gatewayId, RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Echo", "Echo application description", appModules, applicationInputs, applicationOutputs));
        System.out.println("Echo Application Interface Id " + echoInterfaceId);
    } catch (TException e) {
        e.printStackTrace();
    }
}
Also used : TException(org.apache.thrift.TException) OutputDataObjectType(org.apache.airavata.model.application.io.OutputDataObjectType) InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType) ArrayList(java.util.ArrayList) AuthzToken(org.apache.airavata.model.security.AuthzToken)

Example 54 with AuthzToken

use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.

the class SampleEchoExperiment method registerGateway.

private String registerGateway() throws TException {
    Gateway gateway = new Gateway();
    gateway.setGatewayName(gatewayId);
    gateway.setGatewayId(gatewayId);
    gateway.setGatewayApprovalStatus(GatewayApprovalStatus.APPROVED);
    return airavataClient.addGateway(new AuthzToken(""), gateway);
}
Also used : Gateway(org.apache.airavata.model.workspace.Gateway) AuthzToken(org.apache.airavata.model.security.AuthzToken)

Example 55 with AuthzToken

use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.

the class RegisterOGCEUS3Application method registerGatewayResourceProfile.

public static void registerGatewayResourceProfile() {
    try {
        System.out.println("#### Registering Gateway proflie #### \n");
        ComputeResourcePreference stampedeResourcePreferences = RegisterSampleApplicationsUtils.createComputeResourcePreference(stampedeResourceId, "TG-STA110014S", false, null, null, null, "/scratch/01437/ogce/ultrascan_testing/");
        ComputeResourcePreference trestlesResourcePreferences = RegisterSampleApplicationsUtils.createComputeResourcePreference(trestlesResourceId, "sds128", false, null, null, null, "/oasis/scratch/trestles/ogce/temp_project/gta-work-dirs/");
        // ComputeResourcePreference lonestarResourcePreferences = RegisterSampleApplicationsUtils.
        // createComputeResourcePreference(lonestarResourceId, "ULTRASCAN", false, null, null, null,
        // "/scratch/01623/us3/airavata/");
        // 
        // ComputeResourcePreference alamoResourcePreferences = RegisterSampleApplicationsUtils.
        // createComputeResourcePreference(alamoResourceId, null, false, null, null, null,
        // "/mnt/glusterfs/work/");
        GatewayResourceProfile gatewayResourceProfile = new GatewayResourceProfile();
        gatewayResourceProfile.setGatewayID(DEFAULT_GATEWAY);
        gatewayResourceProfile.addToComputeResourcePreferences(stampedeResourcePreferences);
        gatewayResourceProfile.addToComputeResourcePreferences(trestlesResourcePreferences);
        // gatewayResourceProfile.addToComputeResourcePreferences(lonestarResourcePreferences);
        // gatewayResourceProfile.addToComputeResourcePreferences(alamoResourcePreferences);
        String gatewayProfile = airavataClient.registerGatewayResourceProfile(new AuthzToken(""), gatewayResourceProfile);
        System.out.println("Gateway Profile is registered with Id " + gatewayProfile);
    } catch (TException e) {
        e.printStackTrace();
    }
}
Also used : TException(org.apache.thrift.TException) ComputeResourcePreference(org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference) GatewayResourceProfile(org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile) AuthzToken(org.apache.airavata.model.security.AuthzToken)

Aggregations

AuthzToken (org.apache.airavata.model.security.AuthzToken)92 TException (org.apache.thrift.TException)71 InputDataObjectType (org.apache.airavata.model.application.io.InputDataObjectType)46 OutputDataObjectType (org.apache.airavata.model.application.io.OutputDataObjectType)44 ExperimentModel (org.apache.airavata.model.experiment.ExperimentModel)33 UserConfigurationDataModel (org.apache.airavata.model.experiment.UserConfigurationDataModel)28 ComputationalResourceSchedulingModel (org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel)28 AiravataClientException (org.apache.airavata.model.error.AiravataClientException)15 Project (org.apache.airavata.model.workspace.Project)13 ArrayList (java.util.ArrayList)12 InvalidRequestException (org.apache.airavata.model.error.InvalidRequestException)8 HashMap (java.util.HashMap)7 AiravataSystemException (org.apache.airavata.model.error.AiravataSystemException)7 Gateway (org.apache.airavata.model.workspace.Gateway)6 CommandObject (org.apache.airavata.model.appcatalog.appdeployment.CommandObject)5 SCPDataMovement (org.apache.airavata.model.data.movement.SCPDataMovement)5 ComputeResourcePreference (org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference)4 GatewayResourceProfile (org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile)4 ComputeResourceDescription (org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription)2 JobSubmissionInterface (org.apache.airavata.model.appcatalog.computeresource.JobSubmissionInterface)2