Skip to content
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

feat: remove matomo dump backup #228

Merged
merged 1 commit into from
Aug 23, 2024
Merged
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
41 changes: 0 additions & 41 deletions .github/workflows/ingest_day.yml

This file was deleted.

14 changes: 2 additions & 12 deletions .github/workflows/schedule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,8 @@ jobs:
with:
node-version: 20.3.1
cache: "yarn"
- name: Backup
uses: docker://mcr.microsoft.com/azure-cli
with:
args: "bash ./scripts/dump_matomo_yesterday.sh"
env:
AZ_STORAGE_TOKEN: ${{ secrets.AZ_STORAGE_TOKEN }}
- name: Download
uses: docker://mcr.microsoft.com/azure-cli
with:
args: "bash ./scripts/download_dump.sh"
env:
AZ_STORAGE_TOKEN: ${{ secrets.AZ_STORAGE_TOKEN }}
- name: Retrieve data
run: "./scripts/dump_matomo_yesterday.sh"
- name: Ingest
run: |
yarn
Expand Down
14 changes: 2 additions & 12 deletions .github/workflows/schedule_day.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,8 @@ jobs:
with:
node-version: 20.3.1
cache: "yarn"
- name: Backup
uses: docker://mcr.microsoft.com/azure-cli
with:
args: bash ./scripts/dump_matomo_precise_date.sh ${{ github.event.inputs.date }}
env:
AZ_STORAGE_TOKEN: ${{ secrets.AZ_STORAGE_TOKEN }}
- name: Download
uses: docker://mcr.microsoft.com/azure-cli
with:
args: bash ./scripts/download_dump_precise_date.sh ${{ github.event.inputs.date }}
env:
AZ_STORAGE_TOKEN: ${{ secrets.AZ_STORAGE_TOKEN }}
- name: Retrieve data
run: "./scripts/dump_matomo_yesterday.sh"
- name: Ingest
run: |
yarn
Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ As this project lies between different services, it is useful to understand the

```
MATOMO_URL # URL of the Matomo server where raw logs can be found
AZ_STORAGE_TOKEN # Azure token to push dump to Azure blob
ELASTICSEARCH_URL # URL of the Elastic instance where the logs are stored eventually
ELASTIC_TOKEN # Token to use the Elastic API, read-only token is enough for the query lib
CDTN_API_URL # URL of the CDTN API required to generate a cache of the search engine results (without the api and final /)
Expand All @@ -31,14 +30,9 @@ However you may need to create manually all elastic indices which can be achieve

## Log storage

### Backup

We use Azure blob to store daily dumps of the Matomo content. Downloading the data from Matomo and pushing it to Azure is done through a bash script `dump_matomo_yesterday.sh` executed from the Azure Docker image.

### `ingest`

The `ingest` task takes a Matomo dump file in `data/`, convert it, and push the actions to Elastic.
The `download_dump.sh` script allows you to get a dump file from Azure.

```console
ELASTICSEARCH_URL=xxxx API_KEY=yyyy yarn monolog ingest data/
Expand Down
4 changes: 0 additions & 4 deletions scripts/_back/analyse_week.sh

This file was deleted.

19 changes: 0 additions & 19 deletions scripts/_back/download_many.sh

This file was deleted.

16 changes: 0 additions & 16 deletions scripts/_back/dump_ingest.sh

This file was deleted.

58 changes: 0 additions & 58 deletions scripts/_back/dump_matomo_many.sh

This file was deleted.

16 changes: 0 additions & 16 deletions scripts/download_dump.sh

This file was deleted.

15 changes: 0 additions & 15 deletions scripts/download_dump_precise_date.sh

This file was deleted.

11 changes: 0 additions & 11 deletions scripts/dump_matomo_precise_date.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,3 @@ file=$name.json
jq -c -s '[.[][]]' $prefix*.json >$file

rm $prefix*.json

echo "Push file to Azure"
az storage blob upload \
--account-key "$AZ_STORAGE_TOKEN" \
--account-name=cdtndata \
--container logs \
--file $file \
--name $name \
--overwrite

rm $file
10 changes: 0 additions & 10 deletions scripts/dump_matomo_yesterday.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,3 @@ file=$name.json
jq -c -s '[.[][]]' $prefix*.json > $file

rm $prefix*.json

echo "Push file to Azure"
az storage blob upload \
--account-key "$AZ_STORAGE_TOKEN" \
--account-name=cdtndata \
--container logs \
--file $file \
--name $name

rm $file
Loading