Learn, todo and done 17-2/5/21

Learn Clean Code, YouTube PHP: The Right Way, link Udemy courses Design Pattern, Doc, Pattern Libraries Postman for testing API, YouTube Essential Scrum, Chapter [5, 7, 17, 18, 19] Terraform Ansible IBMCloud TechWorld What is IaCode DevOps Crash Course, youtube Todo - Project repo, requirement doc, progress Time to pick up taverna again, it could produce excel with all the columns except the publon review link DOI column Done - Project Todo - Github Done - Github Follow up Add-citation-box-#521 Bring the dropdown item to the front and pass the behat test Update patterned library Review fuw-cicd-#546, review doc at here Exception 'yii\db\Exception' with message 'SQLSTATE[08006] [7] could not translate host name "dockerhost" to address: Name or service not known' AOB Follow up NAS issues Reference ...

May 17, 2021 · 1 min · 126 words · Ken Cho

Learn, todo and done 10-14/5/21

Learn Clean Code, YouTube PHP: The Right Way, link Udemy courses Design Pattern, Doc, Pattern Libraries Postman for testing API, YouTube Essential Scrum, Chapter [5, 7, 17, 18, 19] Terraform Ansible IBMCloud TechWorld What is IaCode DevOps Crash Course, youtube Todo - Project repo, doc Study actionMint in /protected/controller/AdminDatasetController.php /** * post metadata, mint a new DOI * */ public function actionMint() { $result['status'] = false; $status_array = array('Submitted', 'UserStartedIncomplete', 'Curation'); $mds_metadata_url="https://mds.datacite.org/metadata"; $mds_doi_url="https://mds.datacite.org/doi"; $mds_username = Yii::app()->params['mds_username']; $mds_password = Yii::app()->params['mds_password']; $mds_prefix = Yii::app()->params['mds_prefix']; if (isset($_POST['doi'])) { $doi = $_POST['doi']; if (stristr($doi, "/")) { $temp = explode("/", $doi); $doi = $temp[1]; } $doi = trim($doi); $dataset = Dataset::model()->find("identifier=?", array($doi)); if ($dataset && ! in_array($dataset->upload_status, $status_array)) { $xml_data = $dataset->toXML(); $ch= curl_init(); curl_setopt($ch, CURLOPT_URL, $mds_metadata_url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data"); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/xml;charset=UTF-8')); curl_setopt($ch, CURLOPT_USERPWD, $mds_username . ":" . $mds_password); $curl_response = curl_exec($ch); $result['md_curl_response'] = $curl_response; $info1 = curl_getinfo($ch); $result['md_curl_status'] = $info1['http_code']; curl_close($ch) ; } if ($dataset && $result['md_curl_status'] == 201) { $doi_data = "doi=".$mds_prefix."/".$doi."\n"."url=http://gigadb.org/dataset/".$dataset->identifier ; $result['doi_data'] = $doi_data; $ch2= curl_init(); curl_setopt($ch2, CURLOPT_URL, $mds_doi_url); curl_setopt($ch2, CURLOPT_POST, 1); curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch2, CURLOPT_POSTFIELDS, $doi_data); curl_setopt($ch2, CURLOPT_HTTPHEADER, array('Content-Type:application/xml;charset=UTF-8')); curl_setopt($ch2, CURLOPT_USERPWD, $mds_username . ":" . $mds_password); $curl_response = curl_exec($ch2); $result['doi_curl_response'] = $curl_response; $info2 = curl_getinfo($ch2); $result['doi_curl_status'] = $info2['http_code']; curl_close($ch2) ; } if (isset($result['doi_curl_status']) && $result['doi_curl_status'] == 201) { $result['status'] = true; } } echo json_encode($result); Yii::app()->end(); } Done - Project Todo - Github Follow up Add-citation-box-#521 Update <a></a> elements to <ul><li></li></ul> structure Tried to use bootstrap dropdown button Review fuw-cicd-#546, review doc at here Done - Github AOB Follow up server issue 192.168.208.43, 192.168.208.44, 192.168.208.74 have been returned back to BGI IT team Still owning 192.168.208.73 and it is running, because it is hosting www.gigadb.org Follow up NAS issue 杨杰威(Jed Yang) is helping us to gather compliance and regulation information from 曾文君(Ken Zeng), and his supervisor, Alex, would like to know why we would want to have a NAS 郑康和(Kanghe Zheng), the one who suggests us to place the NAS in BGI Tai Po and later the 3rd party Data centre in HK, wants to meet with us together with 周飞羽(Feiyu Zhou) and 田晶(Jing Tian) on 14/5 at 1400 Reference ...

May 10, 2021 · 2 min · 358 words · Ken Cho

Learn, todo and done 3-7/5/21

Learn Clean Code, YouTube PHP: The Right Way, link Udemy courses Design Pattern, Doc, Pattern Libraries Postman for testing API, YouTube Essential Scrum, Chapter [5, 7, 17, 18, 19] Terraform Ansible IBMCloud DevOps Crash Course, youtube Todo - Project repo, doc Local Taverna Study DataCite MDS API Guide Get DOI for publon review link Done - Project Found actionMint in /protected/controller/AdminDatasetController.php /** * post metadata, mint a new DOI * */ public function actionMint() { $result['status'] = false; $status_array = array('Submitted', 'UserStartedIncomplete', 'Curation'); $mds_metadata_url="https://mds.datacite.org/metadata"; $mds_doi_url="https://mds.datacite.org/doi"; $mds_username = Yii::app()->params['mds_username']; $mds_password = Yii::app()->params['mds_password']; $mds_prefix = Yii::app()->params['mds_prefix']; if (isset($_POST['doi'])) { $doi = $_POST['doi']; if (stristr($doi, "/")) { $temp = explode("/", $doi); $doi = $temp[1]; } $doi = trim($doi); $dataset = Dataset::model()->find("identifier=?", array($doi)); if ($dataset && ! in_array($dataset->upload_status, $status_array)) { $xml_data = $dataset->toXML(); $ch= curl_init(); curl_setopt($ch, CURLOPT_URL, $mds_metadata_url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data"); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/xml;charset=UTF-8')); curl_setopt($ch, CURLOPT_USERPWD, $mds_username . ":" . $mds_password); $curl_response = curl_exec($ch); $result['md_curl_response'] = $curl_response; $info1 = curl_getinfo($ch); $result['md_curl_status'] = $info1['http_code']; curl_close($ch) ; } if ($dataset && $result['md_curl_status'] == 201) { $doi_data = "doi=".$mds_prefix."/".$doi."\n"."url=http://gigadb.org/dataset/".$dataset->identifier ; $result['doi_data'] = $doi_data; $ch2= curl_init(); curl_setopt($ch2, CURLOPT_URL, $mds_doi_url); curl_setopt($ch2, CURLOPT_POST, 1); curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch2, CURLOPT_POSTFIELDS, $doi_data); curl_setopt($ch2, CURLOPT_HTTPHEADER, array('Content-Type:application/xml;charset=UTF-8')); curl_setopt($ch2, CURLOPT_USERPWD, $mds_username . ":" . $mds_password); $curl_response = curl_exec($ch2); $result['doi_curl_response'] = $curl_response; $info2 = curl_getinfo($ch2); $result['doi_curl_status'] = $info2['http_code']; curl_close($ch2) ; } if (isset($result['doi_curl_status']) && $result['doi_curl_status'] == 201) { $result['status'] = true; } } echo json_encode($result); Yii::app()->end(); } Todo - Github Learn Terraform and Ansible Follow up PR comments Study #422 Done - Github Rebase Add-citation-box-#521 with upstream/develop Start to review fuw-cicd-#546, review doc at here Terraform, IBMCloud fcc TechWord Provision EC2 on AWS, github Learn Terraform in 10 minutes Using Terraform to create EC2 instance Infrastructure as code Infrastructure as Code with Terraform AOB Follow up server issues Create a ITSM ticket for it Reference ...

May 3, 2021 · 2 min · 305 words · Ken Cho

Learn, todo and done 26-30/4/21

Learn Clean Code, YouTube PHP: The Right Way, link Udemy courses Design Pattern, Doc, Pattern Libraries Postman for testing API, YouTube Essential Scrum, Chapter [5, 7, 17, 18, 19] Todo - Project repo, doc Local Taverna Study how to get DOI for publon review link Done - Project Mint DOI report doc Todo Done Follow up Add-delete-button-#503 At first, I discarded the zii.widgets.CDetailView and recreated the view table using html code <style> table { border-collapse: collapse; width: 100%; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10.3px; } th, td { border: 1px transparent; text-align: left; padding: 3px; } tr:nth-child(odd) { background-color: #E5F1F4; } tr:nth-child(even) { background-color: #f8f8f8; } </style> <table> <tr> <th><?php echo 'ID'; ?></th> <td><?php echo $model->id; ?></td> </tr> <tr> <th><?php echo 'Dataset'; ?> </th> <td><?php echo $model->dataset_id; ?></td> </tr> <tr> <th><?php echo 'File Name'; ?></th> <td><?php echo $model->name; ?></td> </tr> <tr> <th><?php echo 'Location'; ?></th> <td><?php echo $model->location; ?></td> </tr> <tr> <th><?php echo 'Extension'; ?></th> <td><?php echo $model->extension; ?></td> </tr> <tr> <th><?php echo 'Size'; ?></th> <td><?php echo $model->size; ?></td> </tr> <tr> <th><?php echo 'Description'; ?></th> <td><?php echo $model->description; ?></td> </tr> <tr> <th><?php echo 'Release Date'; ?></th> <td><?php echo $model->date_stamp; ?></td> </tr> <tr> <th><?php echo 'File Format'; ?></th> <td><?php echo $model->format_id; ?></td> </tr> <tr> <th><?php echo 'Data Type'; ?></th> <td><?php echo $model->type_id; ?></td> </tr> <tr> <th><?php echo 'Sample'; ?></th> <td><?php echo $name; ?></td> </tr> <?php for ($i = 0; $i < count($attribute_array); $i++) { ?> <tr> <th><?php echo 'File Attribute'; ?></th> <td><?php echo $attribute_array[$i]; ?></td> </tr> <?php } ?> </table> Later, I reverted it because it was not as good as this: <?php $sample_id = FileSample::model()->find('file_id=:file_id', array(':file_id'=>$model->id)); $fileAttributes = FileAttributes::model()->findAll('file_id=:file_id', array(':file_id'=>$model->id)); if(isset($sample_id)) { $sample_name= Sample::model()->find('id=:id',array(':id'=>$sample_id->sample_id)); } $name="Not Set"; if(isset($sample_id)&&isset($sample_name)) { $name=$sample_name->name; } $attributes = array( 'id', 'dataset_id', 'name', 'location', 'extension', 'size', 'description', 'date_stamp', 'format_id', 'type_id', array( 'name'=>'Sample', 'value'=> $name, ) ); if(!empty($fileAttributes)) { foreach ($fileAttributes as $fileAttribute) { array_push($attributes, array('name' => 'FileAttribute', 'value' => $fileAttribute->value)); } } $this->widget('zii.widgets.CDetailView', array( 'data'=>$model, 'attributes'=> $attributes )); And after that, I have to pass the behat test using TableNode to assert the File Attribute row and its value Updated PR descriptions for Add-delete-button-#503 and Add-citation-box-#521 AOB Server issues Confirmed with BGI IT team, 192.168.208.43, 192.168.208.73, 192.168.208.74, these 3 servers are owned by Scott 192.168.208.44, IBM 3630 has no any record about its ownership, but Chris H said it was lent to us in 2014 as a short term solution to the storage crisis Requested Delete right in /cngbdb/giga/ files and directories in Tencent Cloud for test purpose Reference ...

April 26, 2021 · 2 min · 415 words · Ken Cho

Learn, todo and done 19-23/4/21

Learn Clean Code, YouTube PHP: The Right Way, link Udemy courses Design Pattern, Doc Postman for testing API, YouTube Essential Scrum, Chapter [5, 7, 17, 18, 19] Todo - Project repo, doc Local Taverna Done - Project Get DOI from a list of Json return Todo #422 and fix also #272 Try to create pages for Data Type and Dataset Type Done Follow up Add-delete-button-#503 Minor update wordings in behat feature file Separate the file attribute value by comma ,, but Peter suggests better to show 1 file attribute value per each row Add-citation-box-#521 Display dropdown box only for published Dataset Minor update wordings in behat feature file Reference ...

April 19, 2021 · 1 min · 109 words · Ken Cho