Skip to content

Commit

Permalink
Update base image refs (#5)
Browse files Browse the repository at this point in the history
* Update all base image refs in infra/base-images
* Update all base image refs in infra/
* Update oss-fuzz-base refs in infra/
* Update gcr.io refs in infra/
* Update base image refs in tools/
* Add IMG_TAG argument to base images for self-referencing

Updating all references to build with our competition fork.
  • Loading branch information
authwait authored Feb 13, 2025
1 parent 4c2a141 commit ca7977d
Show file tree
Hide file tree
Showing 49 changed files with 249 additions and 234 deletions.
22 changes: 11 additions & 11 deletions infra/base-images/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
#
################################################################################

docker build --pull -t gcr.io/oss-fuzz-base/base-image "$@" infra/base-images/base-image
docker build -t gcr.io/oss-fuzz-base/base-clang "$@" infra/base-images/base-clang
docker build -t gcr.io/oss-fuzz-base/base-builder "$@" infra/base-images/base-builder
docker build -t gcr.io/oss-fuzz-base/base-builder-go "$@" infra/base-images/base-builder-go
docker build -t gcr.io/oss-fuzz-base/base-builder-jvm "$@" infra/base-images/base-builder-jvm
docker build -t gcr.io/oss-fuzz-base/base-builder-python "$@" infra/base-images/base-builder-python
docker build -t gcr.io/oss-fuzz-base/base-builder-rust "$@" infra/base-images/base-builder-rust
docker build -t gcr.io/oss-fuzz-base/base-builder-ruby "$@" infra/base-images/base-builder-ruby
docker build -t gcr.io/oss-fuzz-base/base-builder-swift "$@" infra/base-images/base-builder-swift
docker build -t gcr.io/oss-fuzz-base/base-runner "$@" infra/base-images/base-runner
docker build -t gcr.io/oss-fuzz-base/base-runner-debug "$@" infra/base-images/base-runner-debug
docker build --pull -t ghcr.io/aixcc-finals/base-image "$@" infra/base-images/base-image
docker build -t ghcr.io/aixcc-finals/base-clang "$@" infra/base-images/base-clang
docker build -t ghcr.io/aixcc-finals/base-builder "$@" infra/base-images/base-builder
docker build -t ghcr.io/aixcc-finals/base-builder-go "$@" infra/base-images/base-builder-go
docker build -t ghcr.io/aixcc-finals/base-builder-jvm "$@" infra/base-images/base-builder-jvm
docker build -t ghcr.io/aixcc-finals/base-builder-python "$@" infra/base-images/base-builder-python
docker build -t ghcr.io/aixcc-finals/base-builder-rust "$@" infra/base-images/base-builder-rust
docker build -t ghcr.io/aixcc-finals/base-builder-ruby "$@" infra/base-images/base-builder-ruby
docker build -t ghcr.io/aixcc-finals/base-builder-swift "$@" infra/base-images/base-builder-swift
docker build -t ghcr.io/aixcc-finals/base-runner "$@" infra/base-images/base-runner
docker build -t ghcr.io/aixcc-finals/base-runner-debug "$@" infra/base-images/base-runner-debug
5 changes: 3 additions & 2 deletions infra/base-images/base-builder-fuzzbench/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder
ARG IMG_TAG=latest
FROM ghcr.io/aixcc-finals/base-builder:${IMG_TAG}

# Copy/Run this now to make the cache more resilient.
COPY fuzzbench_install_dependencies /usr/local/bin
RUN fuzzbench_install_dependencies

ENV OSS_FUZZ_ON_DEMAND=1

COPY fuzzbench_build fuzzbench_run_fuzzer fuzzbench_measure /usr/local/bin/
COPY fuzzbench_build fuzzbench_run_fuzzer fuzzbench_measure /usr/local/bin/
3 changes: 2 additions & 1 deletion infra/base-images/base-builder-go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder
ARG IMG_TAG=latest
FROM ghcr.io/aixcc-finals/base-builder:${IMG_TAG}

# Set up Golang environment variables (copied from /root/.bash_profile).
ENV GOPATH /root/go
Expand Down
3 changes: 2 additions & 1 deletion infra/base-images/base-builder-javascript/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder
ARG IMG_TAG=latest
FROM ghcr.io/aixcc-finals/base-builder:${IMG_TAG}

RUN install_javascript.sh
3 changes: 2 additions & 1 deletion infra/base-images/base-builder-jvm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder AS base
ARG IMG_TAG=latest
FROM ghcr.io/aixcc-finals/base-builder:${IMG_TAG} AS base

ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64
ENV JAVA_15_HOME /usr/lib/jvm/java-15-openjdk-amd64
Expand Down
3 changes: 2 additions & 1 deletion infra/base-images/base-builder-python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder
ARG IMG_TAG=latest
FROM ghcr.io/aixcc-finals/base-builder:${IMG_TAG}

RUN install_python.sh
3 changes: 2 additions & 1 deletion infra/base-images/base-builder-ruby/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder
ARG IMG_TAG=latest
FROM ghcr.io/aixcc-finals/base-builder:${IMG_TAG}

RUN git clone https://github.com/trailofbits/ruzzy.git $SRC/ruzzy

Expand Down
3 changes: 2 additions & 1 deletion infra/base-images/base-builder-rust/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder
ARG IMG_TAG=latest
FROM ghcr.io/aixcc-finals/base-builder:${IMG_TAG}

ENV CARGO_HOME=/rust
ENV RUSTUP_HOME=/rust/rustup
Expand Down
3 changes: 2 additions & 1 deletion infra/base-images/base-builder-swift/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder
ARG IMG_TAG=latest
FROM ghcr.io/aixcc-finals/base-builder:${IMG_TAG}

RUN install_swift.sh

Expand Down
3 changes: 2 additions & 1 deletion infra/base-images/base-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-clang
ARG IMG_TAG=latest
FROM ghcr.io/aixcc-finals/base-clang:${IMG_TAG}

COPY install_deps.sh /
RUN /install_deps.sh && rm /install_deps.sh
Expand Down
3 changes: 2 additions & 1 deletion infra/base-images/base-clang/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

# Docker image with clang installed.

FROM gcr.io/oss-fuzz-base/base-image
ARG IMG_TAG=latest
FROM ghcr.io/aixcc-finals/base-image:${IMG_TAG}

ARG arch=x86_64

Expand Down
3 changes: 2 additions & 1 deletion infra/base-images/base-runner-debug/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-runner
ARG IMG_TAG=latest
FROM ghcr.io/aixcc-finals/base-runner:${IMG_TAG}
RUN apt-get update && apt-get install -y valgrind zip

# Installing GDB 12, re https://github.com/google/oss-fuzz/issues/7513.
Expand Down
11 changes: 6 additions & 5 deletions infra/base-images/base-runner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,23 @@

# Build rust stuff in its own image. We only need the resulting binaries.
# Keeping the rust toolchain in the image wastes 1 GB.
FROM gcr.io/oss-fuzz-base/base-image as temp-runner-binary-builder
ARG IMG_TAG=latest
FROM ghcr.io/aixcc-finals/base-image:${IMG_TAG} as temp-runner-binary-builder

RUN apt-get update && apt-get install -y cargo libyaml-dev
RUN cargo install rustfilt

# Using multi-stage build to copy some LLVM binaries needed in the runner image.
FROM gcr.io/oss-fuzz-base/base-clang AS base-clang
FROM gcr.io/oss-fuzz-base/base-builder-ruby AS base-ruby
FROM ghcr.io/aixcc-finals/base-clang:${IMG_TAG} AS base-clang
FROM ghcr.io/aixcc-finals/base-builder-ruby:${IMG_TAG} AS base-ruby

# The base builder image compiles a specific Python version. Using a multi-stage build
# to copy that same Python interpreter into the runner image saves build time and keeps
# the Python versions in sync.
FROM gcr.io/oss-fuzz-base/base-builder AS base-builder
FROM ghcr.io/aixcc-finals/base-builder:${IMG_TAG} AS base-builder

# Real image that will be used later.
FROM gcr.io/oss-fuzz-base/base-image
FROM ghcr.io/aixcc-finals/base-image:${IMG_TAG}

COPY --from=temp-runner-binary-builder /root/.cargo/bin/rustfilt /usr/local/bin

Expand Down
2 changes: 1 addition & 1 deletion infra/base-images/base-runner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
> Base image for fuzzer runners.
```bash
docker run -ti gcr.io/oss-fuzz-base/base-runner <command> <args>
docker run -ti ghcr.io/aixcc-finals/base-runner <command> <args>
```

## Commands
Expand Down
2 changes: 1 addition & 1 deletion infra/build/build_status/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-runner
FROM ghcr.io/aixcc-finals/base-runner

RUN mkdir -p /opt/oss-fuzz/infra/build_status
COPY infra/build/functions/* /opt/oss-fuzz/infra/build_status/
Expand Down
4 changes: 2 additions & 2 deletions infra/build/build_status/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ steps:
args:
- build
- '-t'
- gcr.io/oss-fuzz-base/build-status
- ghcr.io/aixcc-finals/build-status
- '-f'
- infra/build/build_status/Dockerfile
- .
- name: 'gcr.io/oss-fuzz-base/build-status'
- name: 'ghcr.io/aixcc-finals/build-status'
args: []
timeout: 14400s
options:
Expand Down
6 changes: 3 additions & 3 deletions infra/build/functions/base_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
'base-runner',
'base-runner-debug',
]
BASE_PROJECT = 'oss-fuzz-base'
TAG_PREFIX = f'gcr.io/{BASE_PROJECT}/'
BASE_PROJECT = 'aixcc-finals'
TAG_PREFIX = f'ghcr.io/{BASE_PROJECT}/'
MAJOR_TAG = 'v1'
MANIFEST_IMAGES = [
'gcr.io/oss-fuzz-base/base-builder', 'gcr.io/oss-fuzz-base/base-runner'
'ghcr.io/aixcc-finals/base-builder', 'ghcr.io/aixcc-finals/base-runner'
]
TIMEOUT = str(6 * 60 * 60)

Expand Down
6 changes: 3 additions & 3 deletions infra/build/functions/build_and_push_test_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#
################################################################################
"""Script for building and pushing base-images to gcr.io/oss-fuzz-base/ with
"""Script for building and pushing base-images to ghcr.io/aixcc-finals/ with
"-test" suffix. This is useful for using the build infra to test image
changes."""
import logging
Expand All @@ -28,7 +28,7 @@
import base_images
import build_lib

CLOUD_PROJECT = 'oss-fuzz-base'
CLOUD_PROJECT = 'aixcc-finals'
INFRA_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
IMAGES_DIR = os.path.join(INFRA_DIR, 'base-images')
OSS_FUZZ_ROOT = os.path.dirname(INFRA_DIR)
Expand Down Expand Up @@ -71,7 +71,7 @@ def _run_cloudbuild(build_body):
yaml.dump(build_body, yaml_file_handle)

subprocess.run([
'gcloud', 'builds', 'submit', '--project=oss-fuzz-base',
'gcloud', 'builds', 'submit', '--project=aixcc-finals',
f'--config={yaml_file}'
],
cwd=OSS_FUZZ_ROOT,
Expand Down
36 changes: 18 additions & 18 deletions infra/build/functions/build_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import requests
import yaml

BASE_IMAGES_PROJECT = 'oss-fuzz-base'
BASE_IMAGES_PROJECT = 'aixcc-finals'
IMAGE_PROJECT = 'oss-fuzz'

BUILD_TIMEOUT = 20 * 60 * 60
Expand Down Expand Up @@ -267,7 +267,7 @@ def download_coverage_data_steps(project_name, latest, bucket_name, out_dir):
return None

steps.append({
'name': 'gcr.io/oss-fuzz-base/base-runner',
'name': 'ghcr.io/aixcc-finals/base-runner',
'args': ['bash', '-c', (f'mkdir -p {out_dir}/textcov_reports')]
})

Expand All @@ -279,7 +279,7 @@ def download_coverage_data_steps(project_name, latest, bucket_name, out_dir):
'allowFailure': True
})
steps.append({
'name': 'gcr.io/oss-fuzz-base/base-runner',
'name': 'ghcr.io/aixcc-finals/base-runner',
'args': ['bash', '-c', f'ls -lrt {out_dir}/textcov_reports'],
'allowFailure': True
})
Expand Down Expand Up @@ -322,16 +322,16 @@ def get_pull_test_images_steps(test_image_suffix):
"""Returns steps to pull testing versions of base-images and tag them so that
they are used in builds."""
images = [
'gcr.io/oss-fuzz-base/base-builder',
'gcr.io/oss-fuzz-base/base-builder-swift',
'gcr.io/oss-fuzz-base/base-builder-javascript',
'gcr.io/oss-fuzz-base/base-builder-jvm',
'gcr.io/oss-fuzz-base/base-builder-go',
'gcr.io/oss-fuzz-base/base-builder-python',
'gcr.io/oss-fuzz-base/base-builder-ruby',
'gcr.io/oss-fuzz-base/base-builder-rust',
'gcr.io/oss-fuzz-base/base-builder-ruby',
'gcr.io/oss-fuzz-base/base-runner',
'ghcr.io/aixcc-finals/base-builder',
'ghcr.io/aixcc-finals/base-builder-swift',
'ghcr.io/aixcc-finals/base-builder-javascript',
'ghcr.io/aixcc-finals/base-builder-jvm',
'ghcr.io/aixcc-finals/base-builder-go',
'ghcr.io/aixcc-finals/base-builder-python',
'ghcr.io/aixcc-finals/base-builder-ruby',
'ghcr.io/aixcc-finals/base-builder-rust',
'ghcr.io/aixcc-finals/base-builder-ruby',
'ghcr.io/aixcc-finals/base-runner',
]
steps = []
for image in images:
Expand All @@ -346,11 +346,11 @@ def get_pull_test_images_steps(test_image_suffix):
})

# This step is hacky but gives us great flexibility. OSS-Fuzz has hardcoded
# references to gcr.io/oss-fuzz-base/base-builder (in dockerfiles, for
# example) and gcr.io/oss-fuzz-base-runner (in this build code). But the
# references to ghcr.io/aixcc-finals/base-builder (in dockerfiles, for
# example) and ghcr.io/aixcc-finals-runner (in this build code). But the
# testing versions of those images are called e.g.
# gcr.io/oss-fuzz-base/base-builder-testing and
# gcr.io/oss-fuzz-base/base-runner-testing. How can we get the build to use
# ghcr.io/aixcc-finals/base-builder-testing and
# ghcr.io/aixcc-finals/base-runner-testing. How can we get the build to use
# the testing images instead of the real ones? By doing this step: tagging
# the test image with the non-test version, so that the test version is used
# instead of pulling the real one.
Expand Down Expand Up @@ -544,7 +544,7 @@ def get_gcb_url(build_id, cloud_project='oss-fuzz'):
def get_runner_image_name(test_image_suffix):
"""Returns the runner image that should be used. Returns the testing image if
|test_image_suffix|."""
image = f'gcr.io/{BASE_IMAGES_PROJECT}/base-runner'
image = f'ghcr.io/{BASE_IMAGES_PROJECT}/base-runner'
if test_image_suffix:
image += '-' + test_image_suffix
return image
Expand Down
8 changes: 4 additions & 4 deletions infra/build/functions/fuzzbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
def get_engine_project_image(fuzzing_engine, project):
"""Returns the name of an image used to build |project| with
|fuzzing_engine|."""
return f'gcr.io/oss-fuzz-base/{fuzzing_engine}/{project.name}'
return f'ghcr.io/aixcc-finals/{fuzzing_engine}/{project.name}'


def get_env(project, build):
Expand Down Expand Up @@ -128,14 +128,14 @@ def get_build_steps( # pylint: disable=too-many-locals, too-many-arguments
},
{
'name': 'gcr.io/cloud-builders/docker',
'args': ['pull', 'gcr.io/oss-fuzz-base/base-builder-fuzzbench']
'args': ['pull', 'ghcr.io/aixcc-finals/base-builder-fuzzbench']
},
{ # TODO(metzman): Don't overwrite base-builder
'name':
'gcr.io/cloud-builders/docker',
'args': [
'tag', 'gcr.io/oss-fuzz-base/base-builder-fuzzbench',
'gcr.io/oss-fuzz-base/base-builder'
'tag', 'ghcr.io/aixcc-finals/base-builder-fuzzbench',
'ghcr.io/aixcc-finals/base-builder'
]
},
]
Expand Down
2 changes: 1 addition & 1 deletion infra/build/functions/request_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import build_project
import datastore_entities

BASE_PROJECT = 'oss-fuzz-base'
BASE_PROJECT = 'aixcc-finals'
MAX_BUILD_HISTORY_LENGTH = 64
QUEUE_TTL_SECONDS = 60 * 60 * 24 # 24 hours.

Expand Down
2 changes: 1 addition & 1 deletion infra/build/functions/request_coverage_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import build_and_run_coverage
import request_build

BASE_PROJECT = 'oss-fuzz-base'
BASE_PROJECT = 'aixcc-finals'


def get_build_steps(project_name):
Expand Down
2 changes: 1 addition & 1 deletion infra/build/functions/request_introspector_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import build_and_run_coverage
import request_build

BASE_PROJECT = 'oss-fuzz-base'
BASE_PROJECT = 'aixcc-finals'


# TODO (navidem): write test, currently tested manually.
Expand Down
2 changes: 1 addition & 1 deletion infra/build/functions/target_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def run_experiment(project_name,

run_step = {
'name':
'gcr.io/oss-fuzz-base/base-runner',
'ghcr.io/aixcc-finals/base-runner',
'env':
env,
'args': [
Expand Down
Loading

0 comments on commit ca7977d

Please sign in to comment.