Skip to content

Commit

Permalink
AVRO-2238 Update Dockerfile base image from java to openjdk
Browse files Browse the repository at this point in the history
Fix the PHP error due increased json_decode strictness
with PHP 5.6

For more information:
http://php.net/manual/en/migration56.incompatible.php#migration56.incompatible.json-decode

Changed the import of Perl to first do system imports, and then Avro imports

Updated Build,md with the latest versions which are also used in the CI

Removed the explicit stopping of the Ruby server after the first request,
because it would throw an error on the Java client
  • Loading branch information
Fokko Driesprong authored and iemejia committed Jan 21, 2019
1 parent 2eea14c commit 5896f1a
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 26 deletions.
11 changes: 6 additions & 5 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ The following packages must be installed before Avro can be built:

- Java: JDK 1.8, Maven 2 or better, protobuf-compile
- PHP: php5, phpunit, php5-gmp
- Python: 2.5 or greater, python-setuptools for dist target
- Python 2: 2.7 or greater, python-setuptools for dist target
- Python 3: 3.5 or greater
- C: gcc, cmake, asciidoc, source-highlight
- C++: cmake 2.8.4 or greater, g++, flex, bison, libboost-dev
- C++: cmake 3.7.2 or greater, g++, flex, bison, libboost-dev
- C#: mono-devel mono-gmcs nunit
- JavaScript: nodejs, npm
- Ruby: ruby 1.86 or greater, ruby-dev, gem, rake, echoe, yajl-ruby
- Perl: perl 5.8.1 or greater, gmake, Module::Install,
- JavaScript: Node 6.x+, nodejs, npm
- Ruby: Ruby 2.3.3 or greater, ruby-dev, gem, rake, echoe, yajl-ruby
- Perl: Perl 5.24.1 or greater, gmake, Module::Install,
Module::Install::ReadmeFromPod, Module::Install::Repository,
Math::BigInt, JSON::XS, Try::Tiny, Regexp::Common, Encode,
IO::String, Object::Tiny, Compress::ZLib, Test::More,
Expand Down
4 changes: 4 additions & 0 deletions lang/java/ipc/src/test/java/org/apache/avro/TestBulkData.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ public class TestBulkData {
}

public static class BulkDataImpl implements BulkData {

@Override
public ByteBuffer read() { return DATA.duplicate(); }

@Override
public void write(ByteBuffer data) {
Assert.assertEquals(SIZE, data.remaining());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ public String getShortDescription() {
}

@Override
public int run(InputStream in, PrintStream out, PrintStream err,
List<String> args) throws Exception {
public int run(InputStream in, PrintStream out, PrintStream err, List<String> args) throws Exception {
OptionParser p = new OptionParser();
OptionSpec<String> file =
p.accepts("file", "Data file containing request parameters.")
Expand Down
2 changes: 1 addition & 1 deletion lang/js/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ Tap.prototype.writeBinary = function (str, len) {
if (this.pos > this.buf.length) {
return;
}
this.buf.binaryWrite(str, pos, len);
this.buf.write(str, pos, len, 'binary');
};

// Binary comparison methods.
Expand Down
2 changes: 1 addition & 1 deletion lang/perl/t/04_datafile.t
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@

use strict;
use warnings;
use File::Temp;
use Avro::DataFile;
use Avro::BinaryEncoder;
use Avro::BinaryDecoder;
use Avro::Schema;
use File::Temp;
use Test::Exception;
use Test::More;

Expand Down
9 changes: 5 additions & 4 deletions lang/php/test/SchemaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,11 @@ function test_json_decode()
array("bar", "baz", "blurfl"));
$this->assertFalse(is_array(json_decode('null', true)));
$this->assertEquals(json_decode('{"type": "null"}', true), array("type" => 'null'));
foreach (array('true', 'True', 'TRUE', 'tRue') as $truthy)
{
$this->assertEquals(json_decode($truthy, true), true, $truthy);
}

// PHP now only accept lowercase true, and rejects TRUE etc.
// http://php.net/manual/en/migration56.incompatible.php#migration56.incompatible.json-decode
$this->assertEquals(json_decode('true', true), true, 'true');

$this->assertEquals(json_decode('"boolean"'), 'boolean');
}

Expand Down
1 change: 0 additions & 1 deletion lang/ruby/test/tool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def do_POST(req, resp)
writer = Avro::IPC::FramedWriter.new(StringIO.new)
writer.write_framed_message(unframed_resp)
resp.body = writer.to_s
@server.stop
end
end

Expand Down
21 changes: 13 additions & 8 deletions share/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,27 @@
# Dockerfile for installing the necessary dependencies for building Avro.
# See BUILD.txt.

FROM java:8-jdk
FROM openjdk:8

WORKDIR /root

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Add the repository for node.js 4.x
RUN curl -sL https://deb.nodesource.com/setup_4.x | bash -
# Add the repository for node.js 6.x
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -

# Register Microsoft key and feed for .NET SDK
# https://dotnet.microsoft.com/download/linux-package-manager/debian8/sdk-current
RUN wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg && \
mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ && \
wget -q https://packages.microsoft.com/config/debian/8/prod.list && \
wget -q https://packages.microsoft.com/config/debian/9/prod.list && \
mv prod.list /etc/apt/sources.list.d/microsoft-prod.list && \
chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg && \
chown root:root /etc/apt/sources.list.d/microsoft-prod.list

RUN curl https://packages.sury.org/php/apt.gpg | apt-key add --no-tty - && \
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list

# Install dependencies from packages
RUN apt-get -qq update && \
apt-get -qq install --no-install-recommends -y \
Expand All @@ -56,14 +59,13 @@ RUN apt-get -qq update && \
libglib2.0-dev \
libjansson-dev \
libsnappy-dev \
libsnappy1 \
libsnappy1v5 \
make \
maven \
nodejs \
perl \
php5 \
php5-gmp \
phpunit \
php5.6 \
php5.6-gmp \
python \
python-setuptools \
python3-setuptools \
Expand Down Expand Up @@ -99,6 +101,9 @@ RUN curl -L http://cpanmin.us | perl - --self-upgrade && \
IO::String Object::Tiny Compress::Zlib Test::More \
Test::Exception Test::Pod

# Install PHPUnit
RUN wget -O /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-5.6.phar && chmod +x /usr/local/bin/phpunit

# Install Ruby modules
RUN gem install echoe yajl-ruby multi_json snappy

Expand Down
5 changes: 1 addition & 4 deletions share/test/interop/bin/test_rpc_interop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -e # exit on error
set -ex

cd `dirname "$0"`/../../../.. # connect to root

VERSION=`cat share/VERSION.txt`

set -x # echo commands

java_client="java -jar lang/java/tools/target/avro-tools-$VERSION.jar rpcsend"
java_server="java -jar lang/java/tools/target/avro-tools-$VERSION.jar rpcreceive"

Expand Down Expand Up @@ -75,7 +73,6 @@ do
done
read ignore port < $portfile
$client http://127.0.0.1:$port $proto $msg -file $c/request.avro
wait
done
done
done
Expand Down

0 comments on commit 5896f1a

Please sign in to comment.