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

[Archery][CI][Integration] Integration workflow is no longer running Rust integration tests #41481

Closed
paleolimbot opened this issue May 1, 2024 · 4 comments

Comments

@paleolimbot
Copy link
Member

Describe the bug, including details regarding any error messages, version, and platform.

Discovered while trying to modify the integration workflow to get nanoarrow's integration tests to run (#39302). Despite issuing the archery docker run invocation:

archery docker run \
-e ARCHERY_DEFAULT_BRANCH=${{ github.event.repository.default_branch }} \
-e ARCHERY_INTEGRATION_WITH_RUST=1 \

We get:

DEBUG:archery:Executing `['docker', 'run', '--rm', '-e', 'ARCHERY_DEFAULT_BRANCH=main', '-e', 'ARCHERY_INTEGRATION_WITH_RUST=1', '-e', 'ARCHERY_INTEGRATION_WITH_RUST=0', '-e', 'ARROW_CPP_EXE_PATH=/build/cpp/debug', '-e', 'ARROW_RUST_EXE_PATH=/build/rust/debug', '-e', 'CCACHE_COMPILERCHECK=content', '-e', 'CCACHE_COMPRESS=1', '-e', 'CCACHE_COMPRESSLEVEL=6', '-e', 'CCACHE_DIR=/ccache', '-e', 'CCACHE_MAXSIZE=1G', '-e', 'GITHUB_ACTIONS=true', '-v', '/home/runner/work/arrow/arrow:/arrow', '-v', '/home/runner/work/arrow/arrow/.docker/conda-ccache:/ccache', 'apache/arrow-dev:amd64-conda-integration', '/arrow/ci/scripts/integration_arrow_build.sh /arrow /build && /arrow/ci/scripts/integration_arrow.sh /arrow /build']`

https://github.com/apache/arrow/actions/runs/8907059610/job/24460263757#step:8:345

...which results in

 + /arrow/ci/scripts/rust_build.sh /arrow /build
=====================================================================
Not building the Rust implementation.
=====================================================================

The place where this command appears to be calculated is below. It seems that it's doubling the parameters that are included in the docker-compose.yml file (overriding the values in docker-compose.yml seems to be the only way I was able to get Rust to build).

class ComposeConfig:
def __init__(self, config_path, dotenv_path, compose_bin,
using_docker=False, using_buildx=False,
params=None, debug=False):
self.using_docker = using_docker
self.using_buildx = using_buildx
self.debug = debug
config_path = _ensure_path(config_path)
if dotenv_path:
dotenv_path = _ensure_path(dotenv_path)
else:
dotenv_path = config_path.parent / '.env'
if self.debug:
# Log docker version
Docker().run('version')
self._read_env(dotenv_path, params)
self._read_config(config_path, compose_bin)
def _read_env(self, dotenv_path, params):
"""
Read .env and merge it with explicitly passed parameters.
"""
self.dotenv = dotenv_values(str(dotenv_path))
if params is None:
self.params = {}
else:
self.params = {k: v for k, v in params.items() if k in self.dotenv}
# forward the process' environment variables
self.env = os.environ.copy()
# set the defaults from the dotenv files
self.env.update(self.dotenv)
# override the defaults passed as parameters
self.env.update(self.params)
# translate docker's architecture notation to a more widely used one
arch = self.env.get('ARCH', 'amd64')
self.env['ARCH_ALIAS'] = _arch_alias_mapping.get(arch, arch)
self.env['ARCH_SHORT'] = _arch_short_mapping.get(arch, arch)
def _read_config(self, config_path, compose_bin):
"""
Validate and read the docker-compose.yml
"""
yaml = YAML()
with config_path.open() as fp:
self.raw_config = yaml.load(fp)
services = self.raw_config['services'].keys()
self.hierarchy = dict(flatten(self.raw_config.get('x-hierarchy', {})))
self.limit_presets = self.raw_config.get('x-limit-presets', {})
self.with_gpus = self.raw_config.get('x-with-gpus', [])
nodes = self.hierarchy.keys()
errors = []
for name in self.with_gpus:
if name not in services:
errors.append(
'Service `{}` defined in `x-with-gpus` bot not in '
'`services`'.format(name)
)
for name in nodes - services:
errors.append(
'Service `{}` is defined in `x-hierarchy` bot not in '
'`services`'.format(name)
)
for name in services - nodes:
errors.append(
'Service `{}` is defined in `services` but not in '
'`x-hierarchy`'.format(name)
)
# trigger docker-compose's own validation
if self.using_docker:
compose = Docker()
args = ['compose']
else:
compose = Command('docker-compose')
args = []
args += ['--file', str(config_path), 'config']
result = compose.run(*args, env=self.env, check=False,
stderr=subprocess.PIPE, stdout=subprocess.PIPE)
if result.returncode != 0:
# strip the intro line of docker-compose errors
errors += result.stderr.decode().splitlines()
if errors:
msg = '\n'.join([' - {}'.format(msg) for msg in errors])
raise ValueError(
'Found errors with docker-compose:\n{}'.format(msg)
)
rendered_config = StringIO(result.stdout.decode())
self.path = config_path
self.config = yaml.load(rendered_config)
def get(self, service_name):
try:
service = self.config['services'][service_name]
except KeyError:
raise UndefinedImage(service_name)
service['name'] = service_name
service['need_gpu'] = service_name in self.with_gpus
service['ancestors'] = self.hierarchy[service_name]
return service
def __getitem__(self, service_name):
return self.get(service_name)

Component(s)

Archery, Continuous Integration, Integration

@paleolimbot
Copy link
Member Author

@tustvold
Copy link
Contributor

I've filed #41637 with a suggested fix.

In the meantime we have downgraded the Rust toolchain version to 1.77 in arrow-rs' CI to workaround this issue - apache/arrow-rs#5761

@alamb
Copy link
Contributor

alamb commented May 13, 2024

Also possibly of interest is apache/arrow-rs#5761 which may have started running the nanoarrow tests in arrow-rs

kou added a commit that referenced this issue Jul 16, 2024
…or the integration test docker job (#42009)

### Rationale for this change

Currently, nanoarrow and Rust are not being included in the integration tests. The command issued by archery includes multiple environment variable definitions and the rightmost ones disable the extra environment variables.

https://github.com/apache/arrow/actions/runs/9397807525/job/25881776553#step:9:353

```
DEBUG:archery:Executing `['docker', 'run', '--rm', '-e', 'ARCHERY_DEFAULT_BRANCH=main', '-e', 'ARCHERY_INTEGRATION_WITH_NANOARROW=1', '-e', 'ARCHERY_INTEGRATION_WITH_RUST=1', '-e', 'ARCHERY_INTEGRATION_WITH_NANOARROW=0', '-e', 'ARCHERY_INTEGRATION_WITH_RUST=0', '-e', 'ARROW_CPP_EXE_PATH=/build/cpp/debug', '-e', 'ARROW_NANOARROW_PATH=/build/nanoarrow', '-e', 'ARROW_RUST_EXE_PATH=/build/rust/debug', '-e', 'CCACHE_COMPILERCHECK=content', '-e', 'CCACHE_COMPRESS=1', '-e', 'CCACHE_COMPRESSLEVEL=6', '-e', 'CCACHE_DIR=/ccache', '-e', 'CCACHE_MAXSIZE=1G', '-e', 'GITHUB_ACTIONS=true', '-v', '/home/runner/work/arrow/arrow:/arrow', '-v', '/home/runner/work/arrow/arrow/.docker/conda-ccache:/ccache', 'apache/arrow-dev:amd64-conda-integration', '/arrow/ci/scripts/integration_arrow_build.sh /arrow /build && /arrow/ci/scripts/integration_arrow.sh /arrow /build']`
# ...
+ /arrow/ci/scripts/rust_build.sh /arrow /build
=====================================================================
Not building the Rust implementation.
=====================================================================
+ /arrow/ci/scripts/nanoarrow_build.sh /arrow /build
=====================================================================
Not building nanoarrow
=====================================================================
```

### What changes are included in this PR?

This PR updates how environment variables are specified such that the intended value is passed to the docker build.

### Are these changes tested?

Yes

### Are there any user-facing changes?

No
* GitHub Issue: #41481

Lead-authored-by: Dewey Dunnington <[email protected]>
Co-authored-by: Dewey Dunnington <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
@kou kou added this to the 18.0.0 milestone Jul 16, 2024
@kou
Copy link
Member

kou commented Jul 16, 2024

Issue resolved by pull request 42009
#42009

@kou kou closed this as completed Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants