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

GH-6: Add Linux test CI #339

Merged
merged 3 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
50 changes: 50 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# All of the following environment variables are required to set default values
# for the parameters in docker-compose.yml.

# empty prefix means that the docker-compose configuration will use named
# volumes which potentially improves the performance on docker for macos and
# docker for windows, it also prevents the contamination of the source
# directory
# a non-empty prefix means that directories from the host are bind-mounted
# into the container, it should be set to ".docker/" on github actions to keep
# the cache plugin functional
DOCKER_VOLUME_PREFIX=

# turn on inline build cache, this is a docker buildx feature documented
# at https://github.com/docker/buildx#--cache-tonametypetypekeyvalue
BUILDKIT_INLINE_CACHE=1
COMPOSE_DOCKER_CLI_BUILD=1
DOCKER_BUILDKIT=1

# different architecture notations
ARCH=amd64
ARCH_ALIAS=x86_64
ARCH_SHORT=amd64

# Default repository to pull and push images from
REPO=ghcr.io/apache/arrow-java-dev

# The setup attempts to generate coredumps by default, in order to disable the
# coredump generation set it to 0
ULIMIT_CORE=-1

# Default versions for various dependencies
JDK=11
MAVEN=3.9.6
74 changes: 74 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: Test

on:
push:
branches:
- '**'
- '!dependabot/**'
tags:
- '**'
pull_request:

concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true

permissions:
contents: read

env:
DOCKER_VOLUME_PREFIX: ".docker/"

jobs:
ubuntu:
name: AMD64 Ubuntu 22.04 JDK ${{ matrix.jdk }} Maven ${{ matrix.maven }}
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
jdk: [11, 17, 21, 22]
maven: [3.9.6]
image: [java]
env:
JDK: ${{ matrix.jdk }}
MAVEN: ${{ matrix.maven }}
steps:
- name: Checkout Arrow
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
fetch-depth: 0
submodules: recursive
- name: Cache Docker Volumes
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: .docker
key: maven-${{ matrix.jdk }}-${{ matrix.maven }}-${{ hashFiles('**/docker-compose.yml') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to update cache by .java changes. Let's work on it as a separated task.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, since the docker image is just jdk/maven, shouldn't it not depend on the actual Java sources?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this is used to cache mvn ... results. So the cache will depend on *.java too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, the build script starts by wiping the build directory, though. (And we have separate build caching support.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I'm not familiar with Maven cache...

This .docker path caches ~/.m2/ directory. Do we need to cache ~/.m2/? If we don't need to cache ~/.m2/, we can remove this cache.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this is confusing then. If it caches .m2 then it'll cache downloaded dependencies, which is useful, and that depends on pom.xml (not .java though)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update this to hash pom.xml in the new PR

restore-keys: maven-${{ matrix.jdk }}-${{ matrix.maven }}-
- name: Execute Docker Build
env:
# Enables build caching, but not strictly required
DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
run: |
docker compose run \
-e CI=true \
-e "DEVELOCITY_ACCESS_KEY=$DEVELOCITY_ACCESS_KEY" \
${{ matrix.image }}
Comment on lines +71 to +74
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need docker compose pull/docker compose push to cache built images but let's work on it as a separated task.

Copy link
Member

@kou kou Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. We don't need this. Because we use existing Docker images...

We can remove REPO from .env.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ arrow-git.properties
cmake_install.cmake
install_manifest.txt
target/
/.mvn/.develocity/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "testing"]
path = testing
url = https://github.com/apache/arrow-testing.git
52 changes: 52 additions & 0 deletions arrow-format/File.fbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

include "Schema.fbs";

namespace org.apache.arrow.flatbuf;

/// ----------------------------------------------------------------------
/// Arrow File metadata
///

table Footer {
version: org.apache.arrow.flatbuf.MetadataVersion;

schema: org.apache.arrow.flatbuf.Schema;

dictionaries: [ Block ];

recordBatches: [ Block ];

/// User-defined metadata
custom_metadata: [ KeyValue ];
}

struct Block {

/// Index to the start of the RecordBlock (note this is past the Message header)
offset: long;

/// Length of the metadata
metaDataLength: int;

/// Length of the data (this is aligned so there can be a gap between this and
/// the metadata).
bodyLength: long;
}

root_type Footer;
Loading