Skip to content
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,4 @@ timing/*/*.dtps
/bw-output/

## IDE configuration
.vscode/**
.vscode/*.json
18 changes: 16 additions & 2 deletions .vscode/jhrg/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
// For Hyrax, prefix and PATH need to be set. jhrg 3/11/26
"prefix": "/Users/jimg/src/opendap/hyrax/build",
"prefix": "/Users/jimg/src/opendap/hyrax_git/build",
"PATH": "${config:prefix}/bin:${config:prefix}/deps/bin:${env:PATH}",
// C/C++ extensionsettings. jhrg 3/11/26
"C_Cpp.default.configurationProvider": "ms-vscode.makefile-tools",
"C_Cpp.default.compileCommands": "${workspaceFolder}/compile_commands.json",
"C_Cpp.default.includePath": [
Expand All @@ -18,11 +19,24 @@
"${workspaceFolder}/server/**",
"${workspaceFolder}/standalone/**",
"${workspaceFolder}/xmlcommand/**",
"${workspaceFolder}/modules/**",
"${workspaceFolder}/modules/**"
],
"C_Cpp.default.cppStandard": "c++14",
"C_Cpp.default.intelliSenseMode": "macos-clang-arm64",
"C_Cpp.vcFormat.indent.namespaceContents": false,
// Makefile settings. jhrg 3/11/26
"files.associations": {
"*.am": "makefile"
},
"[makefile]": {
"editor.insertSpaces": false
},
// Exclude object files from the file explorer. jhrg 3/29/26
"files.exclude": {
"**/*.o": true,
"**/*.lo": true
},
// Terminal environment settings. jhrg 3/11/26
"terminal.integrated.env.osx": {
"prefix": "${config:prefix}",
"PATH": "${config:PATH}"
Expand Down
105 changes: 105 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# AGENTS.md

## Scope

These instructions apply to the entire `bes` repository.

## Project Context

- `bes` is the Back-End Server for Hyrax and is a long-lived C++ codebase with downstream users who depend on stable behavior.
- Prefer compatibility, behavioral stability, and small reviewable diffs over broad cleanup or refactoring.
- Treat changes to protocol behavior, server startup/configuration, packaging, and installed layout as high risk.

## Primary Build System

- Use autotools for normal development work in this repository.
- A top-level `CMakeLists.txt` exists, but ignore that since it is a relic.

## Autotools Workflow

For a fresh git checkout:

```sh
autoreconf --force --install --verbose
./configure --prefix="$prefix" --with-dependencies="$prefix/deps" --enable-developer
make -j
make check
```

For a source-distribution style build:

```sh
./configure
make -j
make check
```

Notes:

- Check that `prefix` is defined before using commands that rely on it.
- Use `--with-dependencies=<path>` when BES dependencies are installed outside standard system paths.
- `--enable-developer` is the normal developer-mode configure option in this repo.
- Useful configure toggles defined at the top level include `--enable-asan`, `--enable-coverage`, `--without-cmr`, `--without-ngap`, and `--without-s3`.
- `make distcheck` is a supported validation path here; top-level build files already carry `AM_DISTCHECK_CONFIGURE_FLAGS` logic for dependency-aware distcheck runs.

## Testing Expectations

- For code changes, run focused validation first, then broaden test scope when the risk warrants it.
- Default autotools validation is `make check`.
- Parallel test runs are used in CI, but `INSTALL` notes that some tests may object to parallel execution; if `-j` causes issues, retry serially and mention that in your summary.
- If you change build, packaging, or install behavior, consider whether `make distcheck` or the Docker build path should also be exercised.

## CI And Container Workflows

- CI is defined in [`.travis.yml`](.travis.yml) and uses autotools, `make check`, `make distcheck`, coverage builds, and Docker image builds.
- Additional CI in [`.github/workflows`](.github/workflows) for OSX Intel and ARM64.
- Docker builds are driven by [`Dockerfile`](Dockerfile) and [`travis/build-rhel-docker.sh`](travis/build-rhel-docker.sh).
- CI commonly configures with `--disable-dependency-tracking`, `--with-dependencies=$prefix/deps`, and `--enable-developer`.
- Docker and CI assume external dependency artifacts such as hyrax-dependencies and libdap builds; do not hardcode local-only assumptions into those paths.

## Generated Files And Build Artifacts

- Prefer editing source inputs such as [`configure.ac`](configure.ac) and [`Makefile.am`](Makefile.am), not generated outputs like `configure`, `Makefile.in`, or `config.h.in`, unless the task explicitly requires regenerating them.
- This repository may contain checked-in generated files and local build artifacts. Do not delete or revert unrelated generated files just to make the tree look clean.
- If you regenerate autotools outputs, keep the resulting changes tightly scoped and mention that regeneration was performed.

## Documentation

- Top-level API docs are built with `make docs`.
- Doc inputs are generated from top-level templates such as `doxy.conf.in` and `main_page.doxygen.in`; keep template/generated relationships consistent with the chosen build workflow.

## Configuration Awareness

- BES is not just a library build; installation layout and runtime configuration matter.
- `INSTALL` and `README.md` both assume post-install configuration under `etc/bes`, including `bes.conf` and module configuration files.
- When changing defaults, installed paths, service scripts, or startup behavior, call out runtime configuration impact explicitly.

## Legacy C++ Constraints

- Match local style in touched files; avoid unrelated formatting sweeps.
- Avoid API or ABI-impacting changes unless explicitly requested.
- Be conservative with ownership, lifetime, and assertion behavior in older pointer-heavy code.
- Developer mode and release mode differ here (`--enable-developer` vs. `NDEBUG` builds), so consider both when changing assertions, debug-only behavior, or diagnostics.

## Change Discipline

- Do not revert unrelated local changes in a dirty worktree.
- Keep edits narrowly scoped to the request.
- If you encounter unexpected repository changes that conflict with the task, stop and ask how to proceed.
- Do not run destructive git commands unless explicitly requested.

## Review Priorities

When asked to review, prioritize:

1. Behavioral regressions in server responses, protocol handling, and installed/runtime behavior
2. Memory/resource safety and ownership lifetime issues
3. Build-system or packaging regressions in autotools, distcheck, CI, or Docker flows
4. Configuration/install-layout regressions that would affect deployed BES instances
5. Missing or weak regression coverage

## Communication

- State assumptions and environment details explicitly, especially configure flags and dependency locations.
- If full validation was not run, say exactly what was run and what was not.
- If a change depends on external prerequisites such as `libdap`, hyrax-dependencies, AWS-fetched artifacts, or system packages, note that clearly.
18 changes: 16 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# Dockerfile for bes_core images

# This Dockerfile is intended to build a base image that will be used to build
# subsequent images for our production BES/Hyrax images. The build process is
# split into two stages, with the first stage building the BES and the second
# stage copying over the built BES and its dependencies to a slimmer base image.

ARG BUILDER_BASE_IMAGE
ARG FINAL_BASE_IMAGE
FROM ${BUILDER_BASE_IMAGE:-"rockylinux:8"} AS builder

# Sanity check that the required build argument is provided and non-empty, evn
# though a default value is provided above. We want to enforce that the value is
# always specified.
ARG BUILDER_BASE_IMAGE
RUN if [ -z "$BUILDER_BASE_IMAGE" ]; then \
echo "Error: Non-empty BUILDER_BASE_IMAGE must be specified. Exiting."; \
Expand Down Expand Up @@ -59,6 +68,10 @@ COPY . ./bes
RUN sudo chown -R $BES_USER:$BES_USER bes
WORKDIR bes

# *** Note that since this is going to be used in production, the
# --enable-developer configure option should not be used. This is the only
# change that I think we need to make to the build process for production
# images. jhrg 3/29/26
RUN autoreconf -fiv
RUN echo "Sanity check: CPPFLAGS=$CPPFLAGS LDFLAGS=$LDFLAGS prefix=$PREFIX" \
&& ./configure --disable-dependency-tracking \
Expand Down Expand Up @@ -134,7 +147,7 @@ COPY --from=builder /home/$BES_USER/bes/bes_VERSION bes_VERSION
COPY --from=builder /home/$BES_USER/bes/libdap_VERSION libdap_VERSION
COPY --from=builder $DEPS_PREFIX $DEPS_PREFIX

# Copy over everything installed in the builder image
# Copy over everything installed in the builder image.
# This is a little ham-fisted, but seems to be at least sufficient
# (if not particularly elegant!).
COPY --from=builder /etc/bes /etc/bes
Expand Down Expand Up @@ -172,7 +185,8 @@ USER root

# Adapted from bes/spec.all_static.in in RPM creation.
# The four *.pem substitutions may be unnecessary, as those *.pem files may be
# vestigial substitutions for a build process past.
# vestigial substitutions for a build process past. See HYRAX-2075.

RUN sed -i.dist \
-e 's:=.*/bes.log:=/var/log/bes/bes.log:' \
-e 's:=.*/lib/bes:=/usr/lib/bes:' \
Expand Down
3 changes: 3 additions & 0 deletions access-log-processing.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
How I made accesses.06.26.24.txt

cut -f 1 -d ' ' localhost_access_log.2024-06-26.txt | sort -n | uniq -c | sort -r -n > accesses.06.26.24.txt
94 changes: 0 additions & 94 deletions agents-needs-work.md

This file was deleted.

Loading
Loading