Skip to content

Commit 195d74a

Browse files
Initial commit
0 parents  commit 195d74a

File tree

10 files changed

+220
-0
lines changed

10 files changed

+220
-0
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Add a team or username to this file
2+
# Example:
3+
# * @ministryofjustice/analytical-platform

.github/dependabot.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
version: 2
3+
4+
updates:
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
7+
schedule:
8+
interval: "daily"
9+
commit-message:
10+
prefix: ":dependabot: github-actions"
11+
include: "scope"
12+
- package-ecosystem: "docker"
13+
directory: "/"
14+
schedule:
15+
interval: "daily"
16+
commit-message:
17+
prefix: ":dependabot: docker"
18+
include: "scope"
19+
- package-ecosystem: "pip"
20+
directory: "/"
21+
schedule:
22+
interval: "daily"
23+
commit-message:
24+
prefix: ":dependabot: pip"
25+
include: "scope"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Dependency Review
3+
4+
on:
5+
pull_request:
6+
types:
7+
- edited
8+
- opened
9+
- reopened
10+
- synchronize
11+
12+
permissions: {}
13+
14+
jobs:
15+
dependency-review:
16+
if: github.event.repository.private == false
17+
permissions:
18+
contents: read
19+
uses: ministryofjustice/analytical-platform-airflow-github-actions/.github/workflows/shared-dependency-review.yml@c5e5677a7f4f9f65829996f00106c792610facfa # v1.4.1
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Release Container
3+
4+
on:
5+
push:
6+
tags:
7+
- "*"
8+
9+
permissions: {}
10+
11+
jobs:
12+
release-container:
13+
permissions:
14+
contents: read
15+
id-token: write
16+
uses: ministryofjustice/analytical-platform-airflow-github-actions/.github/workflows/shared-release-container.yml@c5e5677a7f4f9f65829996f00106c792610facfa # v1.4.1
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Scan Container
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
permissions: {}
10+
11+
jobs:
12+
scan-container:
13+
permissions:
14+
contents: read
15+
pull-requests: write
16+
uses: ministryofjustice/analytical-platform-airflow-github-actions/.github/workflows/shared-scan-container.yml@c5e5677a7f4f9f65829996f00106c792610facfa # v1.4.1
17+
with:
18+
runtime: python
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Test Container
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
permissions: {}
10+
11+
jobs:
12+
test-container:
13+
permissions:
14+
contents: read
15+
pull-requests: write
16+
uses: ministryofjustice/analytical-platform-airflow-github-actions/.github/workflows/shared-test-container.yml@c5e5677a7f4f9f65829996f00106c792610facfa # v1.4.1

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.env
2+
.terraform/
3+
coverage/
4+
venv/
5+
env/
6+
.DS_STORE
7+
.vscode
8+
*.code-workspace
9+
*.sha256
10+
terraform.tfstate

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM ghcr.io/ministryofjustice/analytical-platform-airflow-python-base:1.8.0@sha256:a7d7872482a845e67fc7f78401a6e4a89d906f07d67aca1f7c636cd3c92ae81a
2+
3+
# Below is an example of how to use the base image
4+
5+
# Switch to root user to install packages
6+
# USER root
7+
8+
# Copy requirements.txt
9+
# COPY requirements.txt requirements.txt
10+
11+
# Copy application code
12+
# COPY src/ .
13+
14+
# Install requirements
15+
# RUN <<EOF
16+
# pip install --no-cache-dir --requirement requirements.txt
17+
# EOF
18+
19+
# Switch back to non-root user (analyticalplatform)
20+
# USER ${CONTAINER_UID}
21+
22+
# Execute main.py script
23+
# ENTRYPOINT ["python3", "main.py"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Crown Copyright (Ministry of Justice)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Analytical Platform Airflow Python Template
2+
3+
[![repo standards badge](https://img.shields.io/endpoint?labelColor=231f20&color=005ea5&style=for-the-badge&label=MoJ%20Compliant&url=https%3A%2F%2Foperations-engineering-reports.cloud-platform.service.justice.gov.uk%2Fapi%2Fv1%2Fcompliant_public_repositories%2Fendpoint%2Fanalytical-platform-airflow-python-template&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABmJLR0QA/wD/AP+gvaeTAAAHJElEQVRYhe2YeYyW1RWHnzuMCzCIglBQlhSV2gICKlHiU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Rv2Mmt/G5WpPF6pHGra7Jv410OVsdaz217AbkAPX3ubkm240belCuudT4Rp5p/DyC2lf9mfq1iq5eFe8/lu+K0YrVp0uret4nAkwlB6vzjI/1PxrlrTp/oNHbzTJI92T1qAT+BfW49MhMg6JUp7ehY5a6Tl2jjmVvitF9fxo5Yq8CaAfAkzLMnySt6uz/1k6bPx59CpCNxGfoSKA30IPoH7cQXdArwCOllFX/i53P5P9a/gNkKpsCMFRuFAAAAABJRU5ErkJggg==)](https://operations-engineering-reports.cloud-platform.service.justice.gov.uk/public-report/analytical-platform-airflow-python-template)
4+
5+
This template repository equips you with the default initial files required for an Analytical Platform Airflow workflow.
6+
7+
## Included Files
8+
9+
The repository comes with the following preset files:
10+
11+
- GitHub Actions workflows
12+
- Dependency review (if your repository is public) (`.github/workflows/dependency-review.yml`)
13+
- Container release to Analytical Platform's ECR (`.github/workflows/release-container.yml`)
14+
- Container scan with Trivy (`.github/workflows/scan-container.yml`)
15+
- Container structure test (`.github/workflows/test-container.yml`)
16+
- CODEOWNERS
17+
- Dependabot configuration
18+
- Dockerfile
19+
- MIT License
20+
21+
## Setup Instructions
22+
23+
Once you've created your repository using this template, ensure the following steps:
24+
25+
### Update README
26+
27+
Edit this README.md file to document your project accurately. Take the time to create a clear, engaging, and informative README.md file. Include information like what your project does, how to install and run it, how to contribute, and any other pertinent details.
28+
29+
### Update repository description
30+
31+
After you've created your repository, GitHub provides a brief description field that appears on the top of your repository's main page. This is a summary that gives visitors quick insight into the project. Using this field to provide a succinct overview of your repository is highly recommended.
32+
33+
This description and your README.md will be one of the first things people see when they visit your repository. It's a good place to make a strong, concise first impression. Remember, this is often visible in search results on GitHub and search engines, so it's also an opportunity to help people discover your project.
34+
35+
### Grant Team Permissions
36+
37+
Assign permissions to the appropriate Ministry of Justice teams. Ensure at least one team is granted Admin permissions. Whenever possible, assign permissions to teams rather than individual users.
38+
39+
### Read about the GitHub repository standards
40+
41+
Familiarise yourself with the Ministry of Justice GitHub Repository Standards. These standards ensure consistency, maintainability, and best practices across all our repositories.
42+
43+
You can find the standards [here](https://user-guide.operations-engineering.service.justice.gov.uk/documentation/information/mojrepostandards.html).
44+
45+
Please read and understand these standards thoroughly and enable them when you feel comfortable.
46+
47+
### Modify the GitHub Standards Badge
48+
49+
Once you've ensured that all the [GitHub Repository Standards](https://user-guide.operations-engineering.service.justice.gov.uk/documentation/information/mojrepostandards.html) have been applied to your repository, it's time to update the Ministry of Justice (MoJ) Compliance Badge located in the README file.
50+
51+
The badge demonstrates that your repository is compliant with MoJ's standards. Please follow these [instructions](https://user-guide.operations-engineering.service.justice.gov.uk/documentation/information/add-repo-badge.html) to modify the badge URL to reflect the status of your repository correctly.
52+
53+
**Please note** the badge will not function correctly if your repository is internal or private. In this case, you may remove the badge from your README.
54+
55+
### Manage Outside Collaborators
56+
57+
To add an Outside Collaborator to the repository, follow the guidelines detailed [here](https://github.com/ministryofjustice/github-collaborators).
58+
59+
### Update CODEOWNERS
60+
61+
(Optional) Modify the CODEOWNERS file to specify the teams or users authorized to approve pull requests.
62+
63+
### Configure Dependabot
64+
65+
Adapt the dependabot.yml file to match your project's [dependency manager](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem) and to enable [automated pull requests for package updates](https://docs.github.com/en/code-security/supply-chain-security).
66+
67+
### Dependency Review
68+
69+
If your repository is private with no GitHub Advanced Security license, remove the `.github/workflows/dependency-review.yml` file.

0 commit comments

Comments
 (0)