Skip to content

Commit 37c788d

Browse files
authored
Merge pull request #506 from GOCDB/release-5.11.0
Release 5.11.0 to master
2 parents 0a1d9eb + 33cb59f commit 37c788d

File tree

330 files changed

+15438
-7805
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

330 files changed

+15438
-7805
lines changed

.codeclimate.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ version: "2"
22
plugins:
33
phpcodesniffer:
44
enabled: true
5+
# Need the beta channel to enforce PSR12,
6+
# see https://docs.codeclimate.com/docs/phpcodesniffer#standard.
7+
channel: "beta"
58
config:
69
standard: "phpcs.xml"
710
phpmd:

.github/workflows/continuous-integration.yml

Lines changed: 16 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -4,92 +4,31 @@ on: [push, pull_request]
44

55
jobs:
66

7-
phpunit-sqlite:
8-
# The SQLite version depends on the current environment. See documentation:
9-
# https://github.com/actions/virtual-environments/tree/main/images/linux
10-
name: "PHPUnit with SQLite, PHP: ${{ matrix.php-version }}"
11-
runs-on: ubuntu-latest
12-
# If true, allow this job to fail:
13-
continue-on-error: true
14-
strategy:
15-
matrix:
16-
# Define jobs for all combinations of values given to be tested:
17-
php-version: ["5.6"]
18-
19-
steps:
20-
- name: "Checkout"
21-
uses: "actions/checkout@v3"
22-
with:
23-
fetch-depth: 2
24-
25-
- name: "Install PHP"
26-
uses: "shivammathur/setup-php@v2"
27-
with:
28-
php-version: "${{ matrix.php-version }}"
29-
coverage: "xdebug"
30-
31-
- name: Validate composer.json and composer.lock
32-
run: composer validate
33-
34-
- name: Cache Composer packages
35-
id: composer-cache
36-
uses: actions/cache@v3
37-
with:
38-
path: vendor
39-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
40-
restore-keys: |
41-
${{ runner.os }}-php-
42-
43-
- name: Install dependencies
44-
run: composer install --no-progress
45-
46-
- name: Set up unit testing
47-
run: .github/actions/setup.sh
48-
env:
49-
DB: sqlite
50-
51-
- name: Run unit tests
52-
run: .github/actions/run_tests.sh
53-
54-
- name: "Upload to Codecov"
55-
uses: "codecov/codecov-action@v3"
56-
57-
587
phpunit-mariadb:
598
name: "PHPUnit with MariaDB: ${{ matrix.mariadb-version }}, PHP: ${{ matrix.php-version }}, extension: ${{ matrix.extension }}"
609
runs-on: ubuntu-latest
61-
# If true, allow the job to fail:
62-
continue-on-error: ${{ matrix.experimental }}
6310
strategy:
6411
# If true, stop jobs if a required job fails:
6512
fail-fast: false
6613
matrix:
6714
# Define jobs for all combinations of php, mariadb and extension, up to "include"
6815
# Tests will be performed for each combination
69-
# These can fail if "experimental" is true. Currently all must pass
70-
php-version: ["5.4", "5.5", "5.6", "7.0", "7.1"]
16+
php-version: ["5.4", "5.5", "5.6", "7.0", "7.1", "7.4"]
7117
mariadb-version: ["10.3"]
7218
extension: ["pdo_mysql"]
73-
experimental: [false]
7419
include:
75-
# Define jobs for individual combinations to be tested
76-
# These can fail if "experimental" is true. Currently all can fail
77-
- php-version: "7.2"
78-
mariadb-version: "10.3"
79-
extension: "pdo_mysql"
80-
experimental: true
81-
- php-version: "7.3"
82-
mariadb-version: "10.3"
83-
extension: "pdo_mysql"
84-
experimental: true
20+
- php-version: "5.4"
21+
composer-json: "composer.json"
22+
- php-version: "5.5"
23+
composer-json: "composer.json"
24+
- php-version: "5.6"
25+
composer-json: "composer.json"
26+
- php-version: "7.0"
27+
composer-json: "composer.json"
28+
- php-version: "7.1"
29+
composer-json: "composer.json"
8530
- php-version: "7.4"
86-
mariadb-version: "10.3"
87-
extension: "pdo_mysql"
88-
experimental: true
89-
- php-version: "8.0"
90-
mariadb-version: "10.3"
91-
extension: "pdo_mysql"
92-
experimental: true
31+
composer-json: "composer-7.4.json"
9332

9433
services:
9534
mariadb:
@@ -106,7 +45,7 @@ jobs:
10645

10746
steps:
10847
- name: "Checkout"
109-
uses: "actions/checkout@v3"
48+
uses: "actions/checkout@v4"
11049
with:
11150
fetch-depth: 2
11251

@@ -122,14 +61,16 @@ jobs:
12261

12362
- name: Cache Composer packages
12463
id: composer-cache
125-
uses: actions/cache@v3
64+
uses: actions/cache@v4
12665
with:
12766
path: vendor
12867
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
12968
restore-keys: |
13069
${{ runner.os }}-php-
13170
13271
- name: Install dependencies
72+
env:
73+
COMPOSER: ${{ matrix.composer-json }}
13374
run: composer install --no-progress
13475

13576
- name: Set up unit testing

INSTALL.md

Lines changed: 48 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This file is best viewed using a browser-plugin for markdown `.md` files.
2626

2727
* [Database server](#database-server)
2828
* Oracle 11g+ or MariaDB/MySQL
29-
* (note: the free Oracle 11g XE Express Editions which comes with a free license is perfectly suitable)
29+
* Oracle 18c XE Express Edition available under the Oracle Free Use Terms and Conditions is suitable for development and testing (https://www.oracle.com/downloads/licenses/oracle-free-license.html).
3030
* MariaDB/MySQL
3131
* package `mariadb-server`
3232

@@ -117,13 +117,23 @@ For GocDB, three URL alias/directory-mappings are needed, one for the portal GUI
117117
Note that, depending on Apache/httpd version, the "Require all granted" statements in gocdbssl.conf may cause an HTTP Error "500 - Invalid configuration..." and can be commented out.
118118

119119
### Database Server
120-
GOCDB uses a DB abstraction layer (Doctrine) and with some configuration should be deployable on different RDBMS platforms that are supported for Doctrine. Instructions are provided here for Oracle (the free Oracle 11g is perfectly suitable) and MySQL/MariaDB.
120+
GOCDB uses a DB abstraction layer (Doctrine) and with some configuration should be deployable on different RDBMS platforms that are supported for Doctrine. Instructions are provided here for Oracle and MySQL/MariaDB.
121121

122-
#### Oracle 11g
123-
The free to use XE/11g Oracle DB can be used to host run GOCDB on Win/nix. To use Oracle on nix systems, the OCI8 extension/driver needs to be compiled and installed.
122+
#### Oracle XE (18c)
123+
The free to use XE/18c Oracle DB can be used to host the GOCDB database for development and testing. This document adapts the instructions used for the unsupported Oracle 11g database. However, using a single, 'common user' at the root of a multitenant container database is not necessarily the best, or most secure, configuration.
124+
125+
To download and install the database server, follow the instructions linked from here - https://www.oracle.com/database/technologies/appdev/xe.html.
126+
127+
Notes on Oracle 18c XE installation:
128+
- "SEVERE: [FATAL] [DBT-06103] The port (5,500) is already in use." is caused by the short host name (alias) not being configured in /etc/hosts. (https://dba.stackexchange.com/questions/268437/fatal-dbt-06103-the-port-5-500-is-already-in-use)
129+
- PATH Bash environment variable should be updated to include the Oracle executables BEFORE the oraenv script is run -
130+
```
131+
export PATH=/opt/oracle/product/18c/dbhomeXE/bin:$PATH
132+
```
133+
134+
#### Compiling/Installing OCI8
135+
Using Oracle on Linux requires the OCI8 extension/driver for php: http://php.net/oci8.
124136

125-
##### Compiling/Installing OCI8
126-
The OCI8 extension/driver for php needs to be installed, see: http://php.net/oci8
127137
This can be most easily installed with the free Oracle Instant Client libs which can be installed in a number of ways (http://php.net/manual/en/oci8.installation.php), but the most easy is via PECL as descibed below:
128138

129139
Install the basic, devel and sqlplus instantclient rpms from Oracle (http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html) and install GCC, PHP dev and pear packages:
@@ -277,36 +287,33 @@ deployment of your GOCDB instance:
277287
* [Deploy Sample Data](#deploy-sample-data) (optional)
278288

279289
### Create DB User/Account <a id="create-db"></a>
280-
#### Oracle
290+
#### Oracle <a id="oracle-user"></a>
281291

282-
If you intend to populate the database from a dump of an existing GOCDB5 instance you do NOT need to create the GOCDB5 user. Simply deploy the data as described at ["Deploy and existing DB"](#deploy-existing-dump) below remembering that you might want to ALTER the password for the GOCDB5 user after the import.
292+
If you intend to populate the database from a dump of an existing GOCDB5 instance you do NOT need to create the GOCDB5 user. Simply deploy the data as described at ["Deploy and existing DB"](#deploy-existing-dump).
283293

284-
Create a dedicated GOCDB5 user using the following script (substitute GOCDB5 for your username and a secure password). Run this script as the Oracle admin/system user:
294+
Create a dedicated GOCDB5 user using the following script (substitute C##GOCDB5 for your username and a secure password). The C## (or c##) prefix is required to indicate an Oracle 'common user'. Run this script as the Oracle admin/system user:
285295

286296
```
287297
-- Manage GOCDB5 user if already exists (optional) --
288-
drop user gocdb5 cascade;
289-
290-
-- CREATE USER SQL
291-
CREATE USER GOCDB5 IDENTIFIED BY <PASSWORD>
298+
DROP USER C##GOCDB5 CASCADE;
299+
CREATE USER C##GOCDB5 IDENTIFIED BY <PASSWORD>
292300
DEFAULT TABLESPACE "USERS"
293301
QUOTA UNLIMITED ON "USERS"
294302
TEMPORARY TABLESPACE "TEMP";
295-
-- ROLES - GRANT "RESOURCE" TO GOCDB5
296-
-- SYSTEM PRIVILEGES
297-
GRANT CREATE TRIGGER TO GOCDB5 ;
298-
GRANT CREATE SEQUENCE TO GOCDB5 ;
299-
GRANT CREATE TABLE TO GOCDB5 ;
300-
GRANT CREATE JOB TO GOCDB5 ;
301-
GRANT CREATE PROCEDURE TO GOCDB5 ;
302-
GRANT CREATE TYPE TO GOCDB5 ;
303-
GRANT CREATE SESSION TO GOCDB5 ;
303+
--
304+
GRANT CREATE TRIGGER TO C##GOCDB5;
305+
GRANT CREATE SEQUENCE TO C##GOCDB5;
306+
GRANT CREATE TABLE TO C##GOCDB5;
307+
GRANT CREATE JOB TO C##GOCDB5;
308+
GRANT CREATE PROCEDURE TO C##GOCDB5;
309+
GRANT CREATE TYPE TO C##GOCDB5;
310+
GRANT CREATE SESSION TO C##GOCDB5;
304311
```
305312

306313
If you are using sqlplus to connect to the database remotely you will need also -
307314

308315
```
309-
GRANT CONNECT TO GOCDB5;
316+
GRANT CONNECT TO C##GOCDB5;
310317
```
311318

312319
By default, Oracle 11g will expire a password in 180 days. In previous versions
@@ -424,21 +431,18 @@ $ php deploy/DeployRequiredDataRunner.php requiredData
424431

425432
### OPTIONAL: Deploy Sample Data<a id="deploy-sample-data"></a>
426433

427-
You can choose to deploy some sample data to seed your DB with sample users,
428-
sites and services. Two sample data sets are available. Choose one of -
429-
430-
1. Minimal - just enough to get going with no real-world associations.
431-
432-
```bash
433-
$ cd lib/Doctrine
434-
$ php deploy/DeploySampleDataRunner.php simpleSampleData
435-
```
436-
1. "Real World" - a small subset derived from real data.
434+
You can choose to deploy some sample data to seed your database. It consists of
435+
a project which contains 2 NGIs, and another NGI not in a project. Each NGI contains
436+
multiple sites, and each site has 1-5 services. Each service belongs to at least one
437+
service group, of which there are 7. Each service group has 5-8 services. The
438+
database is populated with unique sample users, which have roles over relevant site,
439+
NGI, project and service group entities. The sample data has no real-world
440+
associations.
437441

438-
```bash
439-
$ cd lib/Doctrine
440-
$ php deploy/DeploySampleDataRunner.php sampleData
441-
```
442+
```bash
443+
$ cd lib/Doctrine
444+
$ php deploy/DeploySampleDataRunner.php sampleData
445+
```
442446

443447
### ORACLE ONLY: Deploy an existing DB .dmp file to populate your DB<a id="deploy-existing-dump"></a>
444448

@@ -457,13 +461,11 @@ This directory object defines the directory where the .dmp file is loaded from.
457461
```
458462

459463
* Import your dmp file. Note, the example below assumes the 'gocdb5' user/schema does not exist in the db - the import actually creates this user with all its permissions/roles.
460-
If you want to use a different schema/username, then specify this in the value of the remap_schema argument on the right of the colon.
461-
You may need to change different arguments for your install such as modifying the remap_tablespace:
464+
If you want to use a different schema/username, then specify this in the value of the remap_schema argument on the right of the colon. (The following example remaps to an Oracle 'common user' as described in [creating the Oracle user/account](#oracle-user) above, after importing an Oracle 11 dump to an Oracle 18 service). You may need to change different arguments for your install such as modifying the remap_tablespace:
462465

463466
```
464-
$impdp system/******** schemas=gocdb5 directory=dmpdir dumpfile=goc5dump.dmp REMAP_SCHEMA=gocdb5:gocdb5 remap_tablespace=GOCDB5:users table_exists_action=replace logfile=gocdbv5deploy.log
467+
$impdp system/******** schemas=gocdb5 directory=dmpdir dumpfile=goc5dump.dmp REMAP_SCHEMA=gocdb5:c##gocdb5 remap_tablespace=GOCDB5:users table_exists_action=replace logfile=gocdbv5deploy.log
465468
```
466-
467469
Note: If you get the following error, there is a file permissionsissue of some kind.
468470
Try creating a new directory for the dump-file, possibly within your Oracle directory.
469471

@@ -474,6 +476,11 @@ You may need to change different arguments for your install such as modifying th
474476
ORA-06512: at "SYS.UTL_FILE", line 536
475477
ORA-29283: invalid file operation
476478
```
479+
* Change the database password if necessary -
480+
481+
```
482+
SQL> alter user c##gocdb5 identified by <password>;
483+
```
477484

478485
* To generate statistics after importing the dmp file (this improves performance):
479486

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@
55
Grid Operations Configuration Management Database. A Repository, Portal and REST style API for managing Grid and Cloud topology objects including; projects, administrative domains, sites, services, service-endpoints, service-groups, downtimes, users, roles and business rules.
66

77
<span>
8-
<img alt="STFC logo" src="htdocs/images/UKRI_STF_Council-Logo_Horiz-RGB_crop.png" height=57/>
9-
<img alt="EU flag" src="htdocs/images/eu_flag_yellow_low_150.png" height=57 />
10-
<img alt="EGI logo" src="htdocs/images/egi_logo.jpg" height=57 />
11-
<img alt="EOSC-hub logo" src="htdocs/images/eosc-hub-v-web_150.png" height=57 />
8+
<img alt="STFC logo" src="htdocs/images/logos/ukri_stfc.png" height=64/>
9+
<img alt="EU flag" src="htdocs/images/flags/eu.png" height=57 />
10+
<img alt="EGI logo" src="htdocs/images/logos/egi.png" height=57 />
11+
<img alt="EOSC Future logo" src="htdocs/images/logos/eosc_future.png" height=57 />
12+
<img alt="IRIS logo" src="htdocs/images/logos/iris_ac_uk.png" height=57 />
1213
</span>
1314

14-
GOCDB is provided by [STFC](https://stfc.ukri.org/) for [EGI](https://www.egi.eu/federation/), co-funded by [EGI.eu](https://www.egi.eu/) and [EOSC-hub](https://www.eosc-hub.eu/). Licensed under the [Apache 2 License](http://www.apache.org/licenses/LICENSE-2.0).
15+
GOCDB is provided by [STFC](https://stfc.ukri.org/), part of [UK Research and Innovation](https://www.ukri.org/), and is co-funded by [EGI](https://egi.eu) via [EGI-ACE](https://www.egi.eu/project/egi-ace/), [EOSC-Future](https://eoscfuture.eu/) and the [IRIS](https://www.iris.ac.uk/) community.
16+
17+
Licensed under the [Apache 2 License](https://www.apache.org/licenses/LICENSE-2.0).
1518

1619
## Documentation
1720

composer-7.4.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "stfc-egi/gocdb",
3+
"description": "A web portal and REST style API for e-Infrastructure topology managment",
4+
"require": {
5+
"doctrine/orm": "2.6.*"
6+
},
7+
"require-dev": {
8+
"phpunit/phpunit": "4.8.*",
9+
"phpunit/dbunit": ">=1.2",
10+
"phpmd/phpmd": "^2.13",
11+
"squizlabs/php_codesniffer": "^3.7",
12+
"taq/pdooci": "^1.0"
13+
14+
}
15+
}

0 commit comments

Comments
 (0)