Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ETL Viewer #1485

Draft
wants to merge 76 commits into
base: xdmod10.5
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
c1b34f0
PHP 7.2 updates for by-ref function arguments
Jan 21, 2021
48ef04b
Update count usage
Jan 21, 2021
52fccdc
MariaDB Datetime related changes
Jan 21, 2021
f4c14e3
Cloud raw_event table column size update
Jan 21, 2021
1c900fb
Fixing SQL Errors
Jan 21, 2021
60c7fa7
Updates to saveUser to accomodate MariaDB datetime values
Jan 21, 2021
243fc3f
Expected Test Updates made to accomodate Centos8 changes
Jan 21, 2021
7df9cef
Updating XDMoD spec file to Centos8 versions
Jan 21, 2021
6a22f2d
Fixing some additional tests
Jan 21, 2021
6ff838b
Updating chromedriver version to match centos8
Jan 22, 2021
298fd5a
Removing the use of createLogger's non-existant return value
Jan 22, 2021
ce25485
Updating ETL Column Detection SQL for MariaDB 10.2+
Jan 27, 2021
dd82513
This should ahve been with the previous commit
Jan 27, 2021
d3d04cb
Updating Datetime default values to use triggers
Jan 27, 2021
c238b63
Reverting this log change as it's not needed
Jan 27, 2021
99e7739
Updating XDMoD's spec file to support Centos7&8
Jan 27, 2021
05bc7be
Updates to account for PHP7/8 finfo_buffer differences
Jan 27, 2021
637d8d3
Updating ContentType to follow finfo
Jan 27, 2021
c1ff732
Reducing Integration Test Code Duplication
Jan 27, 2021
dc4f37d
Update to use ETLOverseer instead of Actions
Feb 4, 2021
b5ecb84
Documentation / Code clarity updates
Feb 4, 2021
ce38a6d
First go at adding centos8 to the CircleCI build
Mar 3, 2021
85ed631
Udpating centos8 docker image
Mar 4, 2021
3940b6a
Adding OpenSSL Key & Cert Generation
Mar 4, 2021
f399440
Updating the Expected Output for these regression tests
Mar 4, 2021
344ba4f
Fixing saml-idp git repo address
Mar 5, 2021
ac20975
Making the new expected file posix compliant
Mar 5, 2021
957179d
Update the way that expected output is determined for UsageChartsTest
Mar 5, 2021
d3410db
Further updates to UsageChartsTest
Mar 5, 2021
2ac3b53
Restore automatic bootstrapping and testing of Gateways realm
jsperhac Jul 29, 2020
2dd7244
Add gateways test artifact for WarehouseExportControllerTest
jsperhac Jan 8, 2021
502b4da
Update test artifact marking Gateways realm acceptable for raw data
jsperhac Jan 8, 2021
08096a3
Added Gateways realm to test artifact data for Export component
jsperhac Jan 8, 2021
b27f4a3
Add overlooked test artifact for data export
jsperhac Jan 15, 2021
43337c8
Add gateways realm to CircleCI config
jsperhac Mar 2, 2021
71de405
Back out Gateways additions to common test artifacts
jsperhac Mar 10, 2021
f81db15
Updating Pear \ CCR Log to Monolog
ryanrath Oct 28, 2020
1b13236
Style checker fixes & reverting PHP7.2 return type declarations
ryanrath Oct 29, 2020
aa86c92
Reverted this test back to the format expected pre-Monolog
ryanrath Oct 30, 2020
369f839
This was meant for the centos8 branch
ryanrath Oct 30, 2020
26537f7
Actually reverting the expected values for these tests.
ryanrath Oct 30, 2020
e81059f
strpos tests don't need characeters escaped
ryanrath Oct 30, 2020
ed57da3
Resetting the pesky security.php
ryanrath Nov 24, 2020
e7656b9
Minor Cleanup from reviewing Github changes
ryanrath Dec 1, 2020
b6abc7d
Taking care of a PHP Warning that was continually thrown
ryanrath Oct 29, 2020
5b46c42
Updates to XDUser::saveUser to accomodate MariaDB datetime values
ryanrath Oct 29, 2020
d395f81
Expected Test Updates made to accomodate Centos8 changes
ryanrath Oct 29, 2020
e506a04
Style Fix
ryanrath Oct 29, 2020
4924d3f
Adding PHP 7.2 return type declarations and documentation
ryanrath Oct 29, 2020
7e63a9f
Updating expected output to account for json_encode
ryanrath Oct 29, 2020
dad5bd1
chekpoint
ryanrath Nov 12, 2019
bf5f3c2
ETL Viewer Tree View base implementation
ryanrath Dec 16, 2019
4d6ff27
Updated to utilize an Ext TreeGrid
ryanrath Dec 17, 2019
e9df9d5
removing commented out code
ryanrath Dec 17, 2019
1f021bb
Beginnings of selecting a file to view in ETL Viewer
ryanrath Feb 13, 2020
aee8fdc
Exploring adding JsonSerializable to some ETL classes
ryanrath Sep 17, 2020
193a3fd
Catching up
spark0r Sep 21, 2020
b2dd002
checkpoint
ryanrath Oct 5, 2020
b629adb
Updates to allow `getActionsForPipelines` to be used as a TreeGrid so…
Jan 15, 2021
7c45c24
checkpoint
Jan 20, 2021
eeb53f6
Adding Cytoscape Dependencies
Feb 26, 2021
1e1c1bb
De-PHP7-ifying things since this still has to run on PHP5.4
Apr 1, 2021
3dbcfe6
Adding global shift key deteection
Apr 1, 2021
72cb34a
Simplifying the ETLViewer and adding a few features
Apr 1, 2021
53953b0
Checkpointint
Apr 19, 2021
7b11776
Refactoring tab adding
Apr 21, 2021
6f06196
Adding Cytoscape deps and the GraphPanel
Apr 21, 2021
85e5e72
Add support for displaying tables in the Graph Panel
Apr 21, 2021
50559c4
checkpointing
Apr 26, 2021
9a2bd43
Check Pointing
Apr 28, 2021
b4cb365
Adding Graph viewing for an Action and fixing libraries
May 6, 2021
1475eff
Check Pointing so I don't lose any work
Jun 2, 2021
b787d9f
checkpoint
Jun 15, 2021
ffff064
Checkpoint on working Tree Search
Jun 21, 2021
bdec23e
Doing away with the TreeView in place filtering
ryanrath Jun 22, 2021
84552e5
Updating docker images used
Jul 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,35 @@
# Check https://circleci.com/docs/2.0/language-php/ for more details
#
version: 2.1

executors:
centos7:
docker:
- image: tools-ext-01.ccr.xdmod.org/xdmod-9.5.0:centos7.9-1.0
centos8: &centos8-executor
docker:
- image: tools-ext-01.ccr.xdmod.org/centos8-0.1:base
jobs:
build:
parameters:
os:
type: executor
install-type:
type: string
docker:
# The first image entry here will be used as the image for the parent container.
- image: tools-ext-01.ccr.xdmod.org/xdmod-9.5.0:centos7.9-1.0
executor: << parameters.os >>
environment:
COMPOSER_ALLOW_SUPERUSER: 1
XDMOD_REALMS: 'jobs,storage,cloud'
XDMOD_REALMS: 'jobs,storage,cloud,gateways'
XDMOD_IS_CORE: yes
XDMOD_INSTALL_DIR: /xdmod
XDMOD_TEST_MODE: << parameters.install-type >>
steps:
- run:
name: Generate OpenSSL Key
command: openssl genrsa -rand /proc/cpuinfo:/proc/dma:/proc/filesystems:/proc/interrupts:/proc/ioports:/proc/uptime 2048 > /etc/pki/tls/private/localhost.key
- run:
name: Generate Certificate
command: /usr/bin/openssl req -new -key /etc/pki/tls/private/localhost.key -x509 -sha256 -days 365 -set_serial $RANDOM -extensions v3_req -out /etc/pki/tls/certs/localhost.crt -subj "/C=XX/L=Default City/O=Default Company Ltd"
- checkout
# We need to update our acct before we can enable docker layer caching.
#- setup_remote_docker:
Expand Down Expand Up @@ -74,6 +88,19 @@ jobs:
- run: ./tests/integration/runtests.sh --junit-output-dir ~/phpunit
- run: ./tests/regression/post_ingest_test.sh --junit-output-dir ~/phpunit
- run: ./tests/component/runtests.sh --junit-output-dir ~/phpunit
- when:
condition:
equal: [ *centos8-executor, << parameters.os >> ]
steps:
- run:
name: Update the chromdriver version for Centos8
command: sed -i 's/84.0.1/88.0.0/' /root/project/tests/ui/package.json
- run:
name: Install new chromdriver
command: |
cd /root/project/tests/ui
npm install
cd /root/project
- run: ./tests/ui/runtests.sh --headless --log-junit ~/phpunit
- run:
name: 'Run SSO Tests'
Expand All @@ -97,4 +124,8 @@ workflows:
- build:
matrix:
parameters:
os: [centos7, centos8]
install-type: ["fresh_install", "upgrade"]
exclude:
- os: centos8
install-type: "upgrade"
2 changes: 2 additions & 0 deletions bin/xdmod-ingestor
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ ini_set('memory_limit', -1);
try {
main();
} catch (Exception $e) {
global $logger;

do {
fwrite(STDERR, $e->getMessage() . "\n");
fwrite(STDERR, $e->getTraceAsString() . "\n");
Expand Down
1 change: 0 additions & 1 deletion classes/CCR/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
class Logger extends \Monolog\Logger implements LoggerInterface
{

/**
* @inheritDoc
*/
Expand Down
7 changes: 6 additions & 1 deletion classes/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
use stdClass;
use Traversable;

class Configuration extends Loggable implements iConfiguration
class Configuration extends Loggable implements iConfiguration, \JsonSerializable
{
// NOTE: Any properties that need to be accessed in a transformer defined in a subclass cannot be
// private.
Expand Down Expand Up @@ -1428,4 +1428,9 @@ public function __sleep()
{
return array_keys(get_object_vars($this));
}

public function jsonSerialize()
{
return $this->toAssocArray();
}
} // class Configuration
10 changes: 6 additions & 4 deletions classes/DataWarehouse/Data/TimeseriesDataset.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ protected function getSeriesIds($limit, $offset)
$statement = $this->agg_query->getRawStatement($limit, $offset);
$statement->execute();

$groupInstance = reset($this->agg_query->getGroupBys());
$groupBys = $this->agg_query->getGroupBys();
$groupInstance = reset($groupBys);
$groupIdColumn = $groupInstance->getId() . '_id';

$seriesIds = array();
Expand Down Expand Up @@ -114,8 +115,8 @@ public function getDatasets($limit, $offset, $summarize)
$summaryDataset = null;

list($timeGroup, $spaceGroup) = $this->getGroupByClasses();

$statObj = reset($this->query->getStats());
$stats = $this->query->getStats();
$statObj = reset($stats);
$seriesIds = $this->getSeriesIds($limit, $offset);

if (!empty($seriesIds)) {
Expand Down Expand Up @@ -364,7 +365,8 @@ public function export($export_title = 'title')

$exportData['headers'][] = $timeGroup->getName();

$stat = reset($this->query->getStats());
$stats = $this->query->getStats();
$stat = reset($stats);
$stat_unit = $stat->getUnit();

$seriesName = $stat->getName();
Expand Down
13 changes: 12 additions & 1 deletion classes/ETL/DataEndpoint/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use ETL\DataEndpoint\DataEndpointOptions;
use Psr\Log\LoggerInterface;

class File extends aDataEndpoint implements iDataEndpoint
class File extends aDataEndpoint implements iDataEndpoint, \JsonSerializable
{

/**
Expand Down Expand Up @@ -176,4 +176,15 @@ public function __toString()
{
return sprintf('%s (name=%s, path=%s)', get_class($this), $this->name, $this->path);
}

public function jsonSerialize()
{
return array_merge(
parent::jsonSerialize(),
array(
'path' => $this->path,
'mode' => $this->mode
)
);
}
}
14 changes: 13 additions & 1 deletion classes/ETL/DataEndpoint/aDataEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Exception;
use Psr\Log\LoggerInterface;

abstract class aDataEndpoint extends aEtlObject
abstract class aDataEndpoint extends aEtlObject implements \JsonSerializable
{
/**
* @var string The endpoint type (e.g., mysql, pdo, file, url)
Expand Down Expand Up @@ -135,4 +135,16 @@ protected function generateUniqueKey()
*/

abstract public function connect();

public function jsonSerialize()
{
return array_merge(
parent::jsonSerialize(),
array(
'type' => $this->type,
'key' => $this->key,
'key_separator' => $this->keySeparator
)
);
}
}
17 changes: 16 additions & 1 deletion classes/ETL/DataEndpoint/aRdbmsEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Exception;
use PDOException;

abstract class aRdbmsEndpoint extends aDataEndpoint
abstract class aRdbmsEndpoint extends aDataEndpoint implements \JsonSerializable
{
/**
* @ var string The database schema for this endpoint
Expand Down Expand Up @@ -357,4 +357,19 @@ abstract public function schemaExists($schemaName = null);
*/

abstract public function createSchema($schemaName = null);

public function jsonSerialize()
{
return array_merge(
parent::jsonSerialize(),
array(
'config' => $this->config,
'schema' => $this->schema,
'host_name' => $this->hostname,
'port'=> $this->port,
'username'=> $this->username,
'create_schema_if_not_exists' => $this->createSchemaIfNotExists
)
);
}
}
22 changes: 20 additions & 2 deletions classes/ETL/DataEndpoint/aStructuredFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use Psr\Log\LoggerInterface;

abstract class aStructuredFile extends File
abstract class aStructuredFile extends File implements \JsonSerializable
{
/**
* @const integer The default number of bytes for file read operations.
Expand Down Expand Up @@ -239,7 +239,7 @@ protected function attachFilters()
$this->logger->warning(
sprintf("Skipping filter '%s': %s", $config->name, implode(", ", $messages))
);
continue;
continue 2;
}
$filterName = 'xdmod.external_process';
$resource = @stream_filter_prepend($fd, $filterName, STREAM_FILTER_READ, $config);
Expand Down Expand Up @@ -613,4 +613,22 @@ abstract protected function verifyData();
*/

abstract protected function discoverRecordFieldNames();

public function jsonSerialize()
{
return array_merge(
parent::jsonSerialize(),
array(
'record_schema_path' => $this->recordSchemaPath,
'filter_list' => $this->filterList,
'filter_definitions' => $this->filterDefinitions,
'record_separator' => $this->recordSeparator,
'field_separator' => $this->fieldSeparator,
'has_header' => $this->hasHeaderRecord,
'requested_record_field_names' => $this->requestedRecordFieldNames,
'discovered_record_field_names' => $this->discoveredRecordFieldNames ,
'record_pass_through' => $this->recordPassthrough
)
);
}
}
1 change: 1 addition & 0 deletions classes/ETL/DbModel/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ public function getSql($includeSchema = false)
( $this->nullable && "NULL" == $this->default ) ||
( "timestamp" == $this->type && is_numeric($this->default) ) ||
( "timestamp" == $this->type && in_array(strtolower($this->default), $currentTimestampAliases) ) ||
( "datetime" === $this->type && in_array(strtolower($this->default), $currentTimestampAliases) ) ||
is_numeric($this->default) ||
"b'" == substr($this->default, 0, 2) ||
"x'" == substr(strtolower($this->default), 0, 2)
Expand Down
12 changes: 11 additions & 1 deletion classes/ETL/DbModel/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
use ETL\DataEndpoint;
use ETL\DataEndpoint\DataEndpointOptions;

class Entity extends Loggable
class Entity extends Loggable implements \JsonSerializable
{
// The list of required properties for this model. If extending classes define their
// own required properties they should merge them in the constructor by calling
Expand Down Expand Up @@ -499,4 +499,14 @@ public function __toString()
{
return get_class($this);
} // __toString()

public function jsonSerialize()
{
return array(
'properties' => $this->properties,
'required_properties' => $this->requiredProperties,
'default_property_values'=> $this->defaultPropertyValues,
'system_quote_char' => $this->systemQuoteChar
);
}
} // class Entity
34 changes: 25 additions & 9 deletions classes/ETL/DbModel/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,17 +312,33 @@ public function discover($source)
// SMG: We should do a better job of detecting equivalent columns. For example "int unsigned" is
// equivalent to "int(10) unsigned".

$sql = "SELECT
column_name as name, column_type as type, is_nullable as nullable,
character_set_name as charset,
collation_name as collation,
column_default as " . $endpoint->quoteSystemIdentifier("default") . ",
IF('' = extra, NULL, extra) as extra,
IF('' = column_comment, NULL, column_comment) as " . $endpoint->quoteSystemIdentifier("comment") . "
// NOTE: An additional `IF` statement was added to the `COLUMN_DEFAULT` clause as MariaDB 10.2+ started
// reporting default values differently than previous MySQL / MariaDB versions.
// Related links:
// - https://jira.mariadb.org/browse/MDEV-15377
// - https://mariadb.com/kb/en/incompatibilities-and-feature-differences-between-mariadb-102-and-mysql-57/
// - "Since MariaDB supports expressions in the DEFAULT clause, in MariaDB, the INFORMATION_SCHEMA.COLUMNS
// table contains extra fields, and also quotes the DEFAULT value of a string in the COLUMN_DEFAULT
// field in order to distinguish it from an expression.
$sql = "
SELECT column_name AS name,
column_type AS type,
is_nullable AS nullable,
character_set_name AS charset,
collation_name AS collation,
IF(
INSTR(COLUMN_DEFAULT, '\''),
SUBSTR(column_default, 2, LENGTH(COLUMN_DEFAULT) - 2),
IF(COLUMN_DEFAULT = 'NULL',
NULL,
COLUMN_DEFAULT)
) as 'default',
IF('' = extra, NULL, extra) AS extra,
IF('' = column_comment, NULL, column_comment) AS 'comment'
FROM information_schema.columns
WHERE table_schema = :schema
AND table_name = :tablename
ORDER BY ordinal_position ASC";
AND table_name = :tablename
ORDER BY ordinal_position ASC;";

try {
$result = $endpoint->getHandle()->query($sql, $params);
Expand Down
27 changes: 26 additions & 1 deletion classes/ETL/EtlOverseerOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use ETL\DbModel\Query;
use Psr\Log\LoggerInterface;

class EtlOverseerOptions extends \CCR\Loggable
class EtlOverseerOptions extends \CCR\Loggable implements \JsonSerializable
{
// Start of the ETL period
private $startDate = null;
Expand Down Expand Up @@ -953,4 +953,29 @@ private function generateEtlChunkList()

$this->etlPeriodChunkList = $chunkList;
} // generateEtlChunkList()

public function jsonSerialize()
{
return array(
'start_date' => $this->startDate,
'end_date' => $this->endDate,
'number_of_days'=> $this->numberOfDays,
'last_modified_start_date' => $this->lastModifiedStartDate,
'last_modified_end_date' => $this->lastModifiedEndDate,
'etl_interval_chunk_size_days' => $this->etlIntervalChunkSizeDays,
'etl_period_chunk_list' => $this->etlPeriodChunkList,
'force_operation' => $this->forceOperation,
'include_only_resource_codes' => $this->includeOnlyResourceCodes,
'exclude_resource_codes'=> $this->excludeResourceCodes,
'lock_dir' => $this->lockDir,
'lock_file_prefix' => $this->lockFilePrefix,
'default_module_name' => $this->defaultModuleName,
'resource_code_to_id_map_sql'=> $this->resourcecodeToIdMapSql,
'section_names'=> $this->sectionNames,
'action_names' => $this->actionNames,
'dry_run' => $this->dryrun,
'verbose' => $this->verbose,
'supported_overseer_restrictions' => $this->supportedOverseerRestrictions
);
}
} // class EtlOverseerOptions
12 changes: 4 additions & 8 deletions classes/ETL/JsonPointer.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,8 @@ public static function isValidPointer($pointer, $expectedFirstToken = null)
}

if ( null !== $expectedFirstToken ) {
$firstToken = array_shift(
array_slice(array_map('urldecode', explode('/', $pointer)), 1)
);
$tokens = array_slice(array_map('urldecode', explode('/', $pointer)), 1);
$firstToken = array_shift($tokens);
return ( $firstToken == $expectedFirstToken );
}
return true;
Expand All @@ -106,11 +105,8 @@ public static function getFirstToken($pointer)
if ( ! static::isValidPointer($pointer) ) {
return false;
}

return array_shift(
array_slice(array_map('urldecode', explode('/', $pointer)), 1)
);

$tokens = array_slice(array_map('urldecode', explode('/', $pointer)), 1);
return array_shift($tokens);
} // getFirstToken()

/** -----------------------------------------------------------------------------------------
Expand Down
Loading