Skip to content

Commit

Permalink
Merge branch 'main' into prenner/add-similarity-score
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-dillon committed Oct 2, 2024
2 parents 43a705b + 0f1cc50 commit f43280e
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/hma-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
push: true
provenance: false
context: hasher-matcher-actioner
platforms: linux/amd64,linux/arm64
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LC }}/hma:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LC }}/hma:${{ env.VERSION }}
2 changes: 1 addition & 1 deletion hasher-matcher-actioner/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
}
},
"remoteUser": "vscode",
"postCreateCommand": "pip install --editable .[all]",
"mounts": [
"source=python-threatexchange-cmdhistory,target=/commandhistory,type=volume",
"source=${localEnv:HOME}${localEnv:USERPROFILE},target=/host-home-folder,type=bind,consistency=cached"
],
"postCreateCommand": "/workspace/.devcontainer/postcreate.sh",
"postAttachCommand": "/workspace/.devcontainer/startup.sh"
}
15 changes: 15 additions & 0 deletions hasher-matcher-actioner/.devcontainer/postcreate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e

pip install --editable .[all]

# Find Python packages in opt and install them
for setup_script in "$(find /workspace/extensions -name setup.py)"
do
module_dir="$(dirname "$setup_script")"
pip install --editable "$module_dir"
for extension in "$(echo "import setuptools; [ print (p) for p in setuptools.find_packages('${module_dir}') ]" | python)"
do
threatexchange config extensions add "$extension"
done
done
27 changes: 27 additions & 0 deletions hasher-matcher-actioner/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,33 @@ Open Media Match is written in Python, uses [Flask](https://flask.palletsproject

Please see CONTRIBUTING in the repo root for more general guidelines on how to contribute by developing locally and submitting pull requests on GitHub.

# Releasing a New Version

To release a new version of the Open Media Match image, follow these steps:

1. **Update the version.txt file**

The version number is stored in the `version.txt` file located at the project subfolder. Modify this file to reflect the new version number (e.g., `v1.1.0`).

```bash
echo "v1.1.0" > version.txt
```

2. **Merge to main**
Once the `version.txt` file is updated, and merged to main a new build will be triggered automatically via the CI/CD pipeline. This will create a new Docker image with the updated version and be pushed to the registry.

3. **Verify the Build and Release**
Monitor the build process to ensure everything runs smoothly. Once the build completes, the new Docker image will be tagged with the updated version and pushed to the registry.

4. **Test the New Image**
After the new image is successfully built and tagged, it can be tested locally by using the tagged image or deployed to your environment. This process may vary depending on your deployment setup (e.g., Kubernetes, Docker Swarm, etc.).

**Notes:**
- Do the version increase on its own PR to separate version releases from code changes.
- Ensure any expected changes in the codebase are included in the release, and all tests are passing before modifying the `version.txt` file.
- For breaking changes, consider incrementing the major version number (e.g., `v2.0.0`).


# Developer onboarding and environment setup

There are a few different ways you can set up a development instance of Open Media Match and get to work.
Expand Down
1 change: 1 addition & 0 deletions hasher-matcher-actioner/extensions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
3 changes: 3 additions & 0 deletions hasher-matcher-actioner/extensions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Optional Packages

Drop any Python packages here which you need to be installed to the container but which can not be added to the `pyproject.toml`, e.g. proprietary extensions.
2 changes: 1 addition & 1 deletion hasher-matcher-actioner/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.5
1.0.6

0 comments on commit f43280e

Please sign in to comment.