Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.

Commit

Permalink
Gh-987: Upgrade dependencies (#995)
Browse files Browse the repository at this point in the history
* Update selenium to the latest version

* Add missing plugin version
This was defaulting to a very old beta version

* Exclude Log4j dependencies

* Adjust plugin property changed in Gaffer

* Remove plugin versions which are now managed centrally

* Replace usage of CloseableIterable and WrappedCloseableIterable with Iterable

* Replace findbugs with spotbugs

* Updated Gaffer version to 2.0.0-alpha-0.2 (#996)

* Updated Gaffer version to 2.0.0-alpha-0.2

* Added new koryphe function to gafferpy

Co-authored-by: Gaffer <github-actions@github.com>

* Replace tomcat7-maven-plugin with cargo-maven3-plugin, upgrade to Tomcat 9

* Fix Selenium tests to be able to run again

Co-authored-by: t92549 <80890692+t92549@users.noreply.github.com>
Co-authored-by: Gaffer <github-actions@github.com>
  • Loading branch information
3 people authored May 3, 2022
1 parent 278791f commit 6687617
Show file tree
Hide file tree
Showing 16 changed files with 344 additions and 185 deletions.
2 changes: 1 addition & 1 deletion NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gaffer tools is built using maven. This process will automatically pull in depen
projects below.


Gaffer (uk.gov.gchq.gaffer:gaffer2:2.0.0-alpha-0.1):
Gaffer (uk.gov.gchq.gaffer:gaffer2:2.0.0-alpha-0.2):

- Apache License, Version 2.0

Expand Down
4 changes: 2 additions & 2 deletions cd/setup_ui_system_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

mvn install -P quick,road-traffic-demo -B -pl ui &
curl -OL https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-linux64.tar.gz
tar -xf geckodriver-v0.23.0-linux64.tar.gz
curl -OL https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz
tar -xf geckodriver-v0.31.0-linux64.tar.gz
mv geckodriver ui/
sleep 1m
36 changes: 35 additions & 1 deletion mini-accumulo-cluster/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2016-2019 Crown Copyright
~ Copyright 2016-2022 Crown Copyright
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -40,16 +40,49 @@
<groupId>org.apache.accumulo</groupId>
<artifactId>accumulo-minicluster</artifactId>
<version>${accumulo.version}</version>
<exclusions>
<!-- Conflicts with Reload4j -->
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.accumulo</groupId>
<artifactId>accumulo-core</artifactId>
<version>${accumulo.version}</version>
<exclusions>
<!-- Conflicts with Reload4j -->
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<version>${hadoop.version}</version>
<exclusions>
<!-- Conflicts with Reload4j -->
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

Expand All @@ -58,6 +91,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<skipAssembly>${skip.jar-with-dependencies}</skipAssembly>
</configuration>
Expand Down
22 changes: 22 additions & 0 deletions performance-testing/performance-testing-accumulo-store/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,34 @@
<artifactId>accumulo-minicluster</artifactId>
<version>${accumulo.version}</version>
<scope>test</scope>
<exclusions>
<!-- Conflicts with Reload4j -->
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<version>${hadoop.version}</version>
<scope>test</scope>
<exclusions>
<!-- Conflicts with Reload4j -->
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>uk.gov.gchq.gaffer</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import org.apache.hadoop.io.BytesWritable;

import uk.gov.gchq.gaffer.commonutil.iterable.WrappedCloseableIterable;
import uk.gov.gchq.gaffer.data.element.Element;
import uk.gov.gchq.gaffer.data.generator.ElementGenerator;
import uk.gov.gchq.gaffer.exception.SerialisationException;
Expand Down Expand Up @@ -46,6 +45,6 @@ public Iterable<? extends Element> apply(final Iterable<? extends BytesWritable>
}
});
final Iterable<Element> elementIterable = elementStream::iterator;
return new WrappedCloseableIterable<>(elementIterable::iterator);
return elementIterable::iterator;
}
}
11 changes: 11 additions & 0 deletions performance-testing/performance-testing-aws/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@
<groupId>org.apache.accumulo</groupId>
<artifactId>accumulo-server-base</artifactId>
<version>${accumulo.version}</version>
<exclusions>
<!-- Conflicts with Reload4j -->
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>

<!--
Expand Down
22 changes: 22 additions & 0 deletions performance-testing/performance-testing-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,34 @@
<artifactId>accumulo-minicluster</artifactId>
<version>${accumulo.version}</version>
<scope>test</scope>
<exclusions>
<!-- Conflicts with Reload4j -->
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<version>${hadoop.version}</version>
<scope>test</scope>
<exclusions>
<!-- Conflicts with Reload4j -->
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>uk.gov.gchq.gaffer</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import uk.gov.gchq.gaffer.commonutil.iterable.CloseableIterable;
import uk.gov.gchq.gaffer.data.element.Element;
import uk.gov.gchq.gaffer.graph.Graph;
import uk.gov.gchq.gaffer.graph.GraphConfig;
Expand Down Expand Up @@ -114,7 +113,7 @@ private void queryBatch(final Supplier<? extends ElementSeed> elementSeedSupplie
final long startTime = System.currentTimeMillis();
final long numResults;
try {
final CloseableIterable<? extends Element> results = graph.execute(getElements, new User());
final Iterable<? extends Element> results = graph.execute(getElements, new User());
numResults = StreamSupport.stream(results.spliterator(), false).count();
} catch (final OperationException e) {
LOGGER.error("OperationException thrown after " + (System.currentTimeMillis() - startTime) / 1000.0
Expand Down
11 changes: 6 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>uk.gov.gchq.gaffer</groupId>
<artifactId>gaffer2</artifactId>
<version>2.0.0-alpha-0.1</version>
<version>2.0.0-alpha-0.2</version>
</parent>

<artifactId>gaffer-tools</artifactId>
Expand All @@ -36,7 +36,7 @@
</modules>

<properties>
<gaffer.version>2.0.0-alpha-0.1</gaffer.version>
<gaffer.version>2.0.0-alpha-0.2</gaffer.version>
<scm.url>
https://github.com/gchq/gaffer-tools
</scm.url>
Expand Down Expand Up @@ -153,7 +153,8 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${failsafe.version}</version>
<!-- Older Failsafe required for Selenium -->
<version>2.22.2</version>
<executions>
<execution>
<id>system-test</id>
Expand Down Expand Up @@ -188,8 +189,8 @@
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<executions>
<execution>
<id>analyze-compile</id>
Expand Down
2 changes: 1 addition & 1 deletion python-shell/src/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2.0.0-alpha-0.1"
__version__ = "2.0.0-alpha-0.2"

__title__ = "gafferpy"
__description__ = "Gaffer Python Shell"
Expand Down
2 changes: 1 addition & 1 deletion python-shell/src/gafferpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2.0.0-alpha-0.1"
__version__ = "2.0.0-alpha-0.2"

__title__ = "gafferpy"
__description__ = "Gaffer Python Shell"
Expand Down
17 changes: 15 additions & 2 deletions python-shell/src/gafferpy/gaffer_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1090,11 +1090,16 @@ def to_json(self):
class ToSet(AbstractFunction):
CLASS = 'uk.gov.gchq.koryphe.impl.function.ToSet'

def __init__(self):
def __init__(self, implementation=None):
super().__init__(_class_name=self.CLASS)
self.implementation = implementation

def to_json(self):
return super().to_json()
function_json = super().to_json()
if (self.implementation is not None):
function_json["implementation"] = self.implementation

return function_json


class ToArray(AbstractFunction):
Expand Down Expand Up @@ -1338,6 +1343,14 @@ def to_json(self):

return function_json

class ToDouble(AbstractFunction):
CLASS = "uk.gov.gchq.koryphe.impl.function.ToDouble"

def __init__(self):
super().__init__(_class_name=self.CLASS)

def to_json(self):
return super().to_json()

class FirstValid(AbstractFunction):
CLASS = "uk.gov.gchq.koryphe.impl.function.FirstValid"
Expand Down
2 changes: 1 addition & 1 deletion python-shell/src/test/test_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_is_operation_supported(self):
"exampleJson": {
"class": "uk.gov.gchq.gaffer.operation.impl.get.GetAllElements"
},
"outputClassName": "uk.gov.gchq.gaffer.commonutil.iterable.CloseableIterable<uk.gov.gchq.gaffer.data.element.Element>"
"outputClassName": "java.lang.Iterable<uk.gov.gchq.gaffer.data.element.Element>"
}
'''

Expand Down
2 changes: 1 addition & 1 deletion python-shell/src/test/test_connector_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_is_operation_supported(self):
"exampleJson": {
"class": "uk.gov.gchq.gaffer.operation.impl.get.GetAllElements"
},
"outputClassName": "uk.gov.gchq.gaffer.commonutil.iterable.CloseableIterable<uk.gov.gchq.gaffer.data.element.Element>"
"outputClassName": "java.lang.Iterable<uk.gov.gchq.gaffer.data.element.Element>"
}
'''

Expand Down
Loading

0 comments on commit 6687617

Please sign in to comment.