Skip to content

Commit

Permalink
Merge pull request #81 from deligianp/master
Browse files Browse the repository at this point in the history
Refactor provision of on-demand batch computation project and update corresponding workflow file
  • Loading branch information
deligianp authored Sep 3, 2024
2 parents 6f03327 + 5db3acd commit 7c1262d
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 70 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Test
# documentation.

on:
pull_request:
pull_request:
branches: [ main ]

jobs:
Expand All @@ -18,16 +18,16 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Test build
run: docker-compose up -d
- name: Sleep
shell: bash
run: sleep 30;
- name: Test endpoint with output
shell: bash
run: curl --write-out '%{http_code}' --output /dev/null --silent localhost:8080/index.php?r=site/health
- name: Test endpoint
shell: bash
run: bash test-call.bash
- name: End test
run: docker-compose down
# - name: Test build
# run: docker compose up -d
# - name: Sleep
# shell: bash
# run: sleep 30;
# - name: Test endpoint with output
# shell: bash
# run: curl --write-out '%{http_code}' --output /dev/null --silent localhost:8080/index.php?r=site/health
# - name: Test endpoint
# shell: bash
# run: bash test-call.bash
# - name: End test
# run: docker-compose down
2 changes: 1 addition & 1 deletion views/project/new_request.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</div>
<div class="row justify-content-center">
<div class="col-md-4 project">
<?= ToolButton::createButton("$ondemand_batch_icon On-demand batch computations", "",["#"/*‘/project/new-ondemand-request’*/], ["class"=>"btn btn-default btn-lg btn-block tool-button disabled"]) ?> </div>
<?= ToolButton::createButton("$ondemand_batch_icon On-demand batch computations", "",["/project/new-ondemand-request"], ["class"=>"btn btn-default btn-lg btn-block tool-button"]) ?> </div>
</div>
<?php
if (Userw::hasRole('Gold',$superAdminAllowed=true))
Expand Down
120 changes: 66 additions & 54 deletions views/project/on_demand_access.php
Original file line number Diff line number Diff line change
@@ -1,83 +1,95 @@
<?php

use yii\helpers\Html;
use yii\widgets\LinkPager;
use app\components\Headers;
use app\models\Token;
use yii\helpers\Url;
use yii\helpers\Url;

echo Html::CssFile('@web/css/project/tokens.css');
$this->registerJsFile('@web/js/project/index.js', ['depends' => [\yii\web\JqueryAsset::className()]]);

$back_icon='';
$access_icon='<i class="fas fa-external-link-square-alt"></i>';
$update_icon='<i class="fas fa-pencil-alt"></i>';
$back_link='/project/index';
$delete_icon='<i class="fas fa-times"></i>';
$new_icon='<i class="fas fa-plus-circle"></i>';
$exclamation_icon='<i class="fas fa-exclamation-triangle" style="color:orange" title="The Vm belongs to an expired project"></i>';
$back_icon = '';
$access_icon = '<i class="fas fa-external-link-square-alt"></i>';
$update_icon = '<i class="fas fa-pencil-alt"></i>';
$back_link = '/project/index';
$delete_icon = '<i class="fas fa-times"></i>';
$new_icon = '<i class="fas fa-plus-circle"></i>';
$exclamation_icon = '<i class="fas fa-exclamation-triangle" style="color:orange" title="The Vm belongs to an expired project"></i>';
$mode = 0;
$edit_button_class='';
$access_button_class ='';
$edit_button_class = '';
$access_button_class = '';
$ondemand_access_class = '';


Headers::begin() ?>
<?php
echo Headers::widget(
['title'=>'Project management '."</br>",
'subtitle'=>$project->name,
'buttons'=>
[
['fontawesome_class'=>$back_icon,'name'=> 'Back', 'action'=>[$back_link], 'type'=>'a',
'options'=>['class'=>'btn btn-default', 'style'=>'width: 100px; color:grey ']]
],
]);
echo Headers::widget(
['title' => 'Project management ' . "</br>",
'subtitle' => $project->name,
'buttons' =>
[
['fontawesome_class' => $back_icon, 'name' => 'Back', 'action' => [$back_link], 'type' => 'a',
'options' => ['class' => 'btn btn-default', 'style' => 'width: 100px; color:grey ']]
],
]);
?>
<?Headers::end()?>
<? Headers::end() ?>
<br>
<h4><b> Approved resources</b></h4>
<div id="containerIntro">
<h4><b> &emsp; Jobs: &nbsp;</b></h4><p><?=$initial_jobs?>&nbsp;(remaining: &nbsp;<?=$remaining_jobs?>)</p> <br>
<h4><b> &emsp; Cores: &nbsp;</b></h4><p><?=$details->cores?>&nbsp;(average use: &nbsp;<?=round($usage['cpu']/1000,2)?>)</p><br>
<h4><b> &emsp; Ram: &nbsp;</b></h4><p><?=$details->ram?>GB&nbsp;(average use: &nbsp;<?=round($usage['ram']/1000,2)?>GB)</p><br><br>
<h4><b> &emsp; Jobs: &nbsp;</b></h4>
<p><?= $initial_jobs ?>&nbsp;(remaining: &nbsp;<?= $remaining_jobs ?>)</p> <br>
<h4><b> &emsp; Cores: &nbsp;</b></h4>
<p><?= $details->cores ?>&nbsp;(average use: &nbsp;<?= round($usage['cpu'] / 1000, 2) ?>)</p><br>
<h4><b> &emsp; Ram: &nbsp;</b></h4>
<p><?= $details->ram ?>GB&nbsp;(average use: &nbsp;<?= round($usage['ram'] / 1000, 2) ?>GB)</p><br><br>

<p>&nbsp;*These computational resources are available for the execution of containerized software packages and workflows.</p>
<p>&nbsp;*These computational resources are available for the execution of containerized software packages and
workflows.</p>
</div>

<br>
<h4><b> Using the resources</b></h4>
<div id="containerIntro">
<p>&emsp;&emsp;There are two ways to use the approved computational resources of this project:</p> <br>
<p>&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&#8208; Use our Job execution User Interface (UI) to manually run computational analysis tasks leveraging Web-based wizards.</p> <br>
<p>&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&#8208; Use our Job execution API to programmatically run computational analysis tasks (API tokens need to be issued).</p> <br><br>

<p>&emsp;&emsp;You can select the way that better fits your needs (but it's possible to consume your approved resources using both ways):</p><br>
<h4><b>Gaining access</b></h4>
<p>
In order to use the task execution infrastructure an API key is required. You can manage your API keys in the
page:
</p>
<div class="text-center">
<?= Html::a("API keys management", ['/project/token-management', 'id' => $id], ['class' => "btn btn-success btn-md $edit_button_class"]) ?>
</div>

<br>
<div style="float: left; width: 49.5%;text-align:right">
<?=Html::a("Job execution UI",$compute,['class'=>"btn btn-success btn-md $access_button_class $ondemand_access_class", 'style'=>'width:270px; height:60px; text-align: center; line-height: 45px; font-size:20px; ','target'=>'_blank'])?>
<br/>
<br/>
<?=Html::a("API tokens management",['/project/token-management', 'id'=>$id],['class'=>"btn btn-success btn-md $edit_button_class", 'style'=>'width:270px; height:60px; text-align: center; line-height: 45px; font-size:20px;'])?>
</div>

<div style="float: right; width: 49.5%;text-align:left">
<?=Html::a("UI user guide",'index.php?r=site%2Fhelp',['class'=>"btn btn btn-secondary btn-md $access_button_class $ondemand_access_class", 'style'=>'width:270px; height:60px; text-align: center; line-height: 45px; font-size:20px;'])?>
<br/>
<br/>
<?=Html::a("API documentation",'https://schema.athenarc.gr/docs/schema-api/',['class'=>"btn btn btn-secondary btn-md $access_button_class $ondemand_access_class", 'style'=>'width:270px; height:60px; text-align: center; line-height: 45px; font-size:20px;','target'=>'_blank'])?>
<h4><b> Using the resources</b></h4>
<p>&emsp;&emsp;There are two ways to schedule task executions:</p> <br>
<div class="p-4 row">
<div class="col-6 border-right border-muted">
<h5><b>SCHEMA api</b></h5>
<p>
Use our Job execution REST API to programmatically run computational analysis tasks
</p>
<div class="text-center">
<?= Html::a("SCHEMA api Swagger", Yii::$app->params["schema_api_url"] ?? "#", ['class' => "btn btn-success btn-md $access_button_class $ondemand_access_class"]) ?>
</div>
</div>
<div class="col-6">
<h5><b>HYPATIA lab</b></h5>
<p>
Use our Job execution User Interface (UI) to manually run
computational analysis tasks
</p>
<div class="text-center">
<?= Html::a("HYPATIA lab", Yii::$app->params["hypatia_lab_url"] ?? "#", ['class' => "btn btn-md $access_button_class $ondemand_access_class text-white", 'style' => 'background-color: #e6833b', 'target' => '_blank']) ?>
</div>
</div>
</div>

<br>
<br/>
<br>
<br/>
<p class="h4"><b> Monitoring job execution</b></p>
<div id="containerIntro">
<p>&emsp;&emsp;API calls can used to retrieve the status of the computational jobs related to this project (for details, see API documentation).
<br>&emsp;&emsp;You can also examine the status of any job from the respective page of the Job execution UI:</p> <br>

<h4><b>How to schedule on-demand batch computation tasks</b></h4>
<p>
Learn about the task execution infrastructure and how to run tasks on the provided documentation:
<div class="text-center">
<?= Html::a("Documentation", Yii::$app->params["schema_api_docs_url"] ?? "#", ['class' => "btn btn-success btn-md $access_button_class $ondemand_access_class", 'target' => '_blank']) ?>
</div>
<br>
<center>
<?=Html::a("Job monitoring UI",'https://hypatia-comp.athenarc.gr/index.php?r=software%2Fhistory',['class'=>"btn btn-success btn-md $access_button_class $ondemand_access_class", 'style'=>'width:270px; height:60px; text-align: center; line-height: 45px; font-size:20px;','target'=>'_blank'])?>
</center>
</p>
2 changes: 1 addition & 1 deletion views/site/additional_storage_tutorial.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<div class="code ">mkpart primary 2048s 100% </div>
<div class="col-md-12">See the created partition and exit:</div>
<div class="code ">print </div>
<div class="code ">exit </div>
<div class="code ">quit </div>

<div class="row">&nbsp;</div>

Expand Down

0 comments on commit 7c1262d

Please sign in to comment.