Skip to content

Commit

Permalink
Merge pull request #43 from tapis-project/dev
Browse files Browse the repository at this point in the history
- Remove releases directory
- Update version numbers
- Add github action to trigger test suite on successful build of docker images
- Update readme to use installer instead of releases directory
  • Loading branch information
khsa1 authored Dec 11, 2024
2 parents 8e26ce2 + 6ed784a commit e8a94be
Show file tree
Hide file tree
Showing 74 changed files with 77 additions and 24,596 deletions.
47 changes: 46 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Docker Image CI
on:
release:
types: [released]
push:
branches:
- dev
workflow_dispatch:
inputs:
release_tag:
Expand All @@ -19,6 +22,8 @@ jobs:
run: |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
TRAPS_REL=${{ inputs.release_tag }}
elif [[ ${{ github.event_name == 'push' }} == true ]]; then
TRAPS_REL=latest
else
TRAPS_REL=${{ github.event.release.tag_name }}
fi
Expand Down Expand Up @@ -51,6 +56,8 @@ jobs:
run: |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
TRAPS_REL=${{ inputs.release_tag }}
elif [[ ${{ github.event_name == 'push' }} == true ]]; then
TRAPS_REL=latest
else
TRAPS_REL=${{ github.event.release.tag_name }}
fi
Expand Down Expand Up @@ -82,6 +89,8 @@ jobs:
run: |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
TRAPS_REL=${{ inputs.release_tag }}
elif [[ ${{ github.event_name == 'push' }} == true ]]; then
TRAPS_REL=latest
else
TRAPS_REL=${{ github.event.release.tag_name }}
fi
Expand Down Expand Up @@ -114,6 +123,8 @@ jobs:
run: |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
TRAPS_REL=${{ inputs.release_tag }}
elif [[ ${{ github.event_name == 'push' }} == true ]]; then
TRAPS_REL=latest
else
TRAPS_REL=${{ github.event.release.tag_name }}
fi
Expand Down Expand Up @@ -145,6 +156,8 @@ jobs:
run: |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
TRAPS_REL=${{ inputs.release_tag }}
elif [[ ${{ github.event_name == 'push' }} == true ]]; then
TRAPS_REL=latest
else
TRAPS_REL=${{ github.event.release.tag_name }}
fi
Expand Down Expand Up @@ -177,6 +190,8 @@ jobs:
run: |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
TRAPS_REL=${{ inputs.release_tag }}
elif [[ ${{ github.event_name == 'push' }} == true ]]; then
TRAPS_REL=latest
else
TRAPS_REL=${{ github.event.release.tag_name }}
fi
Expand Down Expand Up @@ -216,6 +231,8 @@ jobs:
run: |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
TRAPS_REL=${{ inputs.release_tag }}
elif [[ ${{ github.event_name == 'push' }} == true ]]; then
TRAPS_REL=latest
else
TRAPS_REL=${{ github.event.release.tag_name }}
fi
Expand Down Expand Up @@ -255,6 +272,8 @@ jobs:
run: |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
TRAPS_REL=${{ inputs.release_tag }}
elif [[ ${{ github.event_name == 'push' }} == true ]]; then
TRAPS_REL=latest
else
TRAPS_REL=${{ github.event.release.tag_name }}
fi
Expand Down Expand Up @@ -287,6 +306,8 @@ jobs:
run: |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
TRAPS_REL=${{ inputs.release_tag }}
elif [[ ${{ github.event_name == 'push' }} == true ]]; then
TRAPS_REL=latest
else
TRAPS_REL=${{ github.event.release.tag_name }}
fi
Expand Down Expand Up @@ -319,6 +340,8 @@ jobs:
run: |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
TRAPS_REL=${{ inputs.release_tag }}
elif [[ ${{ github.event_name == 'push' }} == true ]]; then
TRAPS_REL=latest
else
TRAPS_REL=${{ github.event.release.tag_name }}
fi
Expand Down Expand Up @@ -351,6 +374,8 @@ jobs:
run: |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
TRAPS_REL=${{ inputs.release_tag }}
elif [[ ${{ github.event_name == 'push' }} == true ]]; then
TRAPS_REL=latest
else
TRAPS_REL=${{ github.event.release.tag_name }}
fi
Expand All @@ -369,8 +394,28 @@ jobs:
- name: Build and push camera-traps-installer
uses: docker/build-push-action@v5
with:
context: custom_install
context: installer
platforms: linux/amd64,linux/arm64
push: true
tags: tapis/camera-traps-installer:${{ env.TRAPS_REL }}
build-args: REL=${{ env.TRAPS_REL }}

upload_testinfo:
runs-on: ubuntu-latest
environment: main
steps:
- name: Write to testinfo.txt
run: |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
TRAPS_REL=${{ inputs.release_tag }}
elif [[ ${{ github.event_name == 'push' }} == true ]]; then
TRAPS_REL=latest
else
TRAPS_REL=${{ github.event.release.tag_name }}
fi
echo "CTVER=$TRAPS_REL" >> testinfo.txt
- name: Upload test info
uses: actions/upload-artifact@v4
with:
name: testinfo
path: testinfo.txt
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "camera-traps"
version = "0.3.3"
version = "0.4.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ COPY --from=builder /camera-traps/target/release/camera-traps .
# copy default configs
# --build-arg used to pass in the release number
ARG TRAPS_REL
COPY releases/$TRAPS_REL/config/traps.toml /root/traps.toml
COPY releases/$TRAPS_REL/config/traps-image-store.toml /root/traps-image-store.toml
#COPY releases/$TRAPS_REL/config/traps.toml /root/traps.toml
#COPY releases/$TRAPS_REL/config/traps-image-store.toml /root/traps-image-store.toml
COPY resources/log4rs.yml /resources/log4rs.yml

RUN chmod -R 0777 /* || true
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# its value will be the tag assigned to all images that get built.
# For example:
#
# export TRAPS_REL=0.3.3
# export TRAPS_REL=0.3.
# export TRAPS_REL=0.4.0
# export TRAPS_REL=0.4.
#
# NOTE: Right now, building with tag `latest` is not supported. Instead,
# build a semantic version and then tag the result as latest.
Expand Down Expand Up @@ -43,7 +43,7 @@ build-oracle:
build-py-plugins: build-camerapy build-scoring build-generating build-power build-oracle

build-installer:
cd custom_install && docker build -t tapis/camera-traps-installer:${TRAPS_REL} --build-arg REL=${TRAPS_REL} .; cd ../
cd installer && docker build -t tapis/camera-traps-installer:${TRAPS_REL} --build-arg REL=${TRAPS_REL} .; cd ../

build: build-engine build-py-plugins build-installer

Expand All @@ -61,4 +61,4 @@ push-all:
cd external_plugins/image_generating_plugin/ && docker buildx build --platform linux/arm64,linux/amd64 --push -t tapis/image_generating_plugin_py:${TRAPS_REL} --build-arg REL=${TRAPS_REL} .; cd ../..
cd external_plugins/power_measuring_plugin/ && docker buildx build --platform linux/arm64,linux/amd64 --push -t tapis/power_measuring_plugin_py:${TRAPS_REL} --build-arg REL=${TRAPS_REL} .; cd ../..
cd external_plugins/oracle_plugin/ && docker buildx build --platform linux/arm64,linux/amd64 --push -t tapis/oracle_plugin:${TRAPS_REL} --build-arg REL=${TRAPS_REL} .; cd ../..
cd custom_install && docker buildx build --platform linux/arm64,linux/amd64 --push -t tapis/camera-traps-installer:${TRAPS_REL} --build-arg REL=${TRAPS_REL} .; cd ../
cd installer && docker buildx build --platform linux/arm64,linux/amd64 --push -t tapis/camera-traps-installer:${TRAPS_REL} --build-arg REL=${TRAPS_REL} .; cd ../
25 changes: 9 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ The event-engine supports *internal* and *external* plugins. Internal plugins a

To quickly start the application under [Docker](https://docs.docker.com/get-docker/) using docker-compose, follow these steps:

1. cd releases
2. Follow the directions in the README.md file
1. ./installer/install.sh $PWD ./installer/example_input.yml
2. cd test
3. docker-compose up
4. docker-compose down

## Application Configuration

Expand Down Expand Up @@ -169,17 +171,8 @@ docker run --gpus=all --rm -it ubuntu nvidia-smi
```
The output should be similar to the output from Step 1.

3. *Update the Camera Traps Compose File to Use GPUs*. Starting with release 0.3.3, the official Camera Traps releases docker-compose files include stanzas for making NVIDIA GPUs available to
both the Image Scoring and Power Monitoring plugins. At this time, those stanzas must be
uncommented; see the [docker-compose.yml](releases/0.3.3/docker-compose.yml) file for more details.


## Support for ARM CPUs

*This section is a work in progress...*

We are currently working on support for ARM CPUs, including support for Mac OSX M* hardware.

3. *Update the Camera Traps Compose File to Use GPUs*. Starting with release 0.4, the installer includes options for making NVIDIA GPUs available to
both the Image Scoring and Power Monitoring plugins. See the [Installer README](installer/README.md) for more details.


# Developer Information
Expand Down Expand Up @@ -239,10 +232,10 @@ The instructions in this section assume [Docker](https://docs.docker.com/get-doc
From the top-level camera-traps directory, issue the following command to build the application's Docker images:

make build
See [Makefile](https://github.com/tapis-project/camera-traps/blob/main/Makefile) for details. From the [releases](https://github.com/tapis-project/camera-traps/tree/main/releases) directory, navigate to the subdirectory of the specific release you want to run. Issue the following command to run the application, including the external plugins for which it's configured:
See [Makefile](https://github.com/tapis-project/camera-traps/blob/main/Makefile) for details. Use the installer [install script](installer/install.sh) to create a run directory. See the installer [README](installer/README.md) for more details. Then, navigate to the new run directory. Issue the following command to run the application, including the external plugins for which it's configured:

docker-compose up
See [docker-compose.yaml](https://github.com/tapis-project/camera-traps/blob/main/releases/0.3.2/docker-compose.yml) for details. From the same release directory, issue the following command to stop the application:
See [docker-compose.yaml](installer/templates/docker-compose.yml) for details. From the same release directory, issue the following command to stop the application:

docker-compose down

Expand Down Expand Up @@ -273,7 +266,7 @@ When implementing a plugin the choice between internal and external is often tec

## Release Procedures

When development on a new release begins a launch configuration is created in the new release's own [releases](https://github.com/tapis-project/camera-traps/tree/main/releases) subdirectory. When development completes and the final version of the release's images are pushed to docker hub, we tag those images with the release number and with the "latest" tag.
When development on a new release begins, create a new branch. If you would to test your changes, merge into the dev branch. This will trigger the building of docker images with the latest tag and a [suite of tests](https://github.com/ICICLE-ai/ml_workbench_test_suite). When development completes and the final version of the release's images are pushed to docker hub, we tag those images with the release number.

To be able to rebuild a release at anytime, we also tag the release's source code in github. The tag is the same as the release version number. Once confident that the tagged code is stable, release tags can be protected using github [tag protection](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/configuring-tag-protection-rules).

Expand Down
1 change: 0 additions & 1 deletion custom_install/example_input.yml

This file was deleted.

4 changes: 2 additions & 2 deletions external_plugins/image_generating_plugin/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ python = "^3.10"
pillow = "^9.4.0"
pyzmq = "^25.0.0"
tapis-pyevents = "^0.1.0"
tapis-ctevents = "^0.3.1"
tapis-ctevents = "^0.4.0"


[build-system]
Expand All @@ -19,4 +19,4 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
# TODO
image_generating_plugin = 'image_generating_plugin:main'
image_generating_plugin = 'image_generating_plugin:main'
2 changes: 1 addition & 1 deletion external_plugins/image_scoring_plugin/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ traitlets = "5.4.0"
typing-extensions = "4.4.0"
urllib3 = "1.26.14"
wcwidth = "0.2.5"
tapis-ctevents = "^0.3.1"
tapis-ctevents = "^0.4.0"

[build-system]
requires = ["poetry-core"]
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions custom_install/README.md → installer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Important Optional Configurations
* `ct_version`: The release version (i.e., image tag) for
the camera traps software container images.

* Example: 0.3.3
* Example: 0.4.0

* `run_containers_as_user`: Whether to run all containers
as the user's (i.e., the installer's) UID and GID. (Default: true)
Expand Down Expand Up @@ -189,7 +189,7 @@ This is a complete list of all possible configurations.

* `ct_version`: The release version (i.e., image tag) for the camera traps software container images

* Example: 0.3.3
* Example: 0.4.0

* `host_config_dir`: Path on the host where configuration
directory resides.
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions custom_install/defaults.yml → installer/defaults.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# General
ct_version: 0.3.3
ct_version: 0.4.0
host_config_dir: ./config
use_host_pid: true
run_containers_as_user: true
Expand Down Expand Up @@ -54,4 +54,4 @@ ckn_kafka_broker_address: 129.114.35.150
ckn_kafka_broker_port: 9092
ckn_enable_power_monitoring: true
experiment_id:
user_id:
user_id:
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 2 additions & 0 deletions installer/example_input.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
install_dir: test
use_gpu_in_scoring: false
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 0 additions & 6 deletions releases/0.3.1/config/image_gen_config.json

This file was deleted.

22 changes: 0 additions & 22 deletions releases/0.3.1/config/traps-image-store.toml

This file was deleted.

Loading

0 comments on commit e8a94be

Please sign in to comment.