Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
username: ${{ fromJson(secrets.DOCKERHUB).username }}
password: ${{ fromJson(secrets.DOCKERHUB).password }}

- name: Build and Push Dependencies Image
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
username: ${{ fromJson(secrets.DOCKERHUB).username }}
password: ${{ fromJson(secrets.DOCKERHUB).password }}

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
Expand Down Expand Up @@ -75,8 +75,8 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
username: ${{ fromJson(secrets.DOCKERHUB).username }}
password: ${{ fromJson(secrets.DOCKERHUB).password }}

- name: Build Notebook,docs Docker
env:
Expand Down
39 changes: 21 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
username: ${{ fromJson(secrets.DOCKERHUB).username }}
password: ${{ fromJson(secrets.DOCKERHUB).password }}

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
Expand Down Expand Up @@ -69,8 +69,8 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
username: ${{ fromJson(secrets.DOCKERHUB).username }}
password: ${{ fromJson(secrets.DOCKERHUB).password }}

- name: Build Notebook
env:
Expand Down Expand Up @@ -102,31 +102,34 @@ jobs:
run: 'TOKEN=${{ secrets.GITHUBPAT }} ./github-release.sh'
shell: bash

trigger_demos_buils:
runs-on: ubuntu-latest
needs:
- build_notebooks_and_publish_pypi
steps:
- uses: actions/checkout@v3
- name: repository dispatch
- name: Publish docs content image
run: |
curl -X POST https://api.github.com/repos/aperture-data/demos/actions/workflows/13727133/dispatches \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUBPAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-d '{"ref":"master","inputs":{}}'
source version.sh
read_version
docker build -f docs-content/Dockerfile -t "aperturedata/aperturedb-python-docs:v$BUILD_VERSION" .
docker push "aperturedata/aperturedb-python-docs:v$BUILD_VERSION"
shell: bash

- name: Update docs provider version in infra
env:
GH_TOKEN: ${{ secrets.PAT_INFRA }}
run: |
source version.sh
read_version
jq -n --arg tag "v$BUILD_VERSION" \
'{event_type:"update-tag",client_payload:{environment:"develop",component:"python-client",tag:$tag}}' \
| gh api repos/aperture-data/infra/dispatches --input -
shell: bash

trigger_docs_deploy:
trigger_demos_buils:
runs-on: ubuntu-latest
needs:
- build_notebooks_and_publish_pypi
steps:
- uses: actions/checkout@v3
- name: repository dispatch
run: |
curl -X POST https://api.github.com/repos/aperture-data/docs/actions/workflows/64451786/dispatches \
curl -X POST https://api.github.com/repos/aperture-data/demos/actions/workflows/13727133/dispatches \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUBPAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
username: ${{ fromJson(secrets.DOCKERHUB).username }}
password: ${{ fromJson(secrets.DOCKERHUB).password }}

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
username: ${{ fromJson(secrets.DOCKERHUB).username }}
password: ${{ fromJson(secrets.DOCKERHUB).password }}

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
Expand Down Expand Up @@ -94,8 +94,8 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
username: ${{ fromJson(secrets.DOCKERHUB).username }}
password: ${{ fromJson(secrets.DOCKERHUB).password }}

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
username: ${{ fromJson(secrets.DOCKERHUB).username }}
password: ${{ fromJson(secrets.DOCKERHUB).password }}

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
Expand Down Expand Up @@ -67,8 +67,8 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
username: ${{ fromJson(secrets.DOCKERHUB).username }}
password: ${{ fromJson(secrets.DOCKERHUB).password }}

- name: Build Notebook Docker
run: BUILD_COMPLETE=true NO_PUSH=true ./ci.sh
Expand Down
24 changes: 24 additions & 0 deletions aperturedb/Constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,30 @@ def is_in(self, key, val_array) -> Constraints:
self.constraints[self._conjunction][key] = ["in", val_array]
return self

def contains(self, key, value) -> Constraints:
self.constraints[self._conjunction][key] = ["contains", value]
return self

def icontains(self, key, value) -> Constraints:
Comment on lines +50 to +54
self.constraints[self._conjunction][key] = ["icontains", value]
return self

def startswith(self, key, value) -> Constraints:
self.constraints[self._conjunction][key] = ["startswith", value]
return self

def istartswith(self, key, value) -> Constraints:
self.constraints[self._conjunction][key] = ["istartswith", value]
return self

def like(self, key, value) -> Constraints:
self.constraints[self._conjunction][key] = ["like", value]
return self

def ilike(self, key, value) -> Constraints:
self.constraints[self._conjunction][key] = ["ilike", value]
return self

def check(self, entity):
for key, op in self.constraints.items():
if key not in entity:
Expand Down
2 changes: 1 addition & 1 deletion aperturedb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import signal
import sys

__version__ = "0.4.60"
__version__ = "0.4.61"

logger = logging.getLogger(__name__)

Expand Down
7 changes: 7 additions & 0 deletions docs-content/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM alpine:3
RUN apk add --no-cache bash rsync
COPY aperturedb/ /content/aperturedb/
COPY examples/ /content/examples/
COPY docs-content/publish.sh /publish.sh
ENV DOCS_PROVIDER=aperturedb-python
ENTRYPOINT ["bash", "/publish.sh"]
32 changes: 32 additions & 0 deletions docs-content/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# Upload a complete content generation to docs over its internal rsync service.
set -euo pipefail

: "${DOCS_PROVIDER:?DOCS_PROVIDER must be set}"
target=${DOCS_RSYNC_URL-rsync://docs-connections:873/content}
while [[ "$target" == */ ]]; do
target=${target%/}
done
command=(rsync -rlt --mkpath --timeout=120 --contimeout=10)
temporary=$(mktemp -d)
trap 'rm -rf -- "$temporary"' EXIT
trap 'exit 130' INT
trap 'exit 143' TERM
touch "$temporary/.ready"

while true; do
read -r generation < /proc/sys/kernel/random/uuid
generation=${generation//-/}
destination="$target/$DOCS_PROVIDER/$generation"

# The receiver ignores this generation until the separate marker arrives.
if "${command[@]}" /content/ "$destination/data/" &&
"${command[@]}" "$temporary/.ready" "$destination/"; then
printf 'Uploaded %s %s\n' "$DOCS_PROVIDER" "$generation"
break
else
status=$?
printf 'Upload failed (rsync exit %s); retrying in 10 seconds\n' "$status" >&2
sleep 10
fi
done