-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix uploading datapackages from iTAK iOS client #90
Draft
Matthew-Beckett
wants to merge
9
commits into
tkuester:main
Choose a base branch
from
Matthew-Beckett:feature/itak-datapackage-upload
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a89d92e
Add basic Dockerfile for building fixed version of Taky
Matthew-Beckett 0473f51
Add GitHub action workflow for building Taky images
Matthew-Beckett eb1e35b
Fix up invalid context and left-over invalid image name
Matthew-Beckett 7dbf574
Change push from input to true
Matthew-Beckett 6b410b9
Fix invalid reference to docker metadata tags
Matthew-Beckett 1058cbe
Fix uo dockerfile
Matthew-Beckett 691f69f
Update .gitignore
Matthew-Beckett 59a06a2
Merge branch 'feature/dockerfile' into feature/itak-datapackage-upload
Matthew-Beckett c94f427
Add basic endpoint for uploading datapackage to dps via itak client
Matthew-Beckett File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
env: | ||
PLATFORMS: linux/amd64, linux/arm64, linux/armv7 | ||
|
||
jobs: | ||
build_images: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ inputs.image-name }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
|
||
- name: Set up QEMU | ||
# Needed as part of https://github.com/docker/buildx/issues/495#issuecomment-1043341496 | ||
id: qemu | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
image: tonistiigi/binfmt:latest | ||
platforms: all | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Docker meta for taky | ||
id: taky-meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ghcr.io/${{ github.repository_owner }}/taky | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: true | ||
platforms: ${{ env.PLATFORMS }} | ||
pull: true | ||
build-args: VERSION=${{ github.ref_name }} | ||
tags: ${{ steps.taky-meta.outputs.tags }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new | ||
|
||
- name: Move cache | ||
run: | | ||
rm -rf /tmp/.buildx-cache | ||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ htmlcov | |
*.pem | ||
*.p12 | ||
*.zip | ||
.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# First stage: builder | ||
FROM python:3.11 as builder | ||
|
||
ENV TAKY_VERSION=0.9 | ||
ENV PUBLIC_IP=192.168.0.60 | ||
|
||
WORKDIR /build | ||
|
||
RUN git clone --depth 1 https://github.com/tkuester/taky.git -b ${TAKY_VERSION} | ||
|
||
WORKDIR /build/taky | ||
|
||
RUN python3 -m pip install --upgrade pip && \ | ||
python3 -m pip install -r requirements.txt && \ | ||
python3 setup.py install && \ | ||
find /usr/local -name '*.pyc' -delete && \ | ||
find /usr/local -name '__pycache__' -type d -exec rm -rf {} + | ||
|
||
RUN takyctl setup --public-ip=${PUBLIC_IP} /etc/taky | ||
|
||
# Second stage: runtime | ||
FROM python:3.11-slim as runtime | ||
|
||
WORKDIR / | ||
|
||
RUN mkdir /var/taky | ||
|
||
COPY --from=builder /usr/local /usr/local | ||
COPY --from=builder /etc/taky /etc/taky | ||
|
||
ENTRYPOINT [ "taky", "-c", "/etc/taky/taky.conf" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can change these to:
and this workflow will only be activated by manual triggering from the Actions menu
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch