Skip to content

Commit 4e3ef9d

Browse files
Matrix builds, interactive installer (#465)
1 parent fc8e893 commit 4e3ef9d

File tree

31 files changed

+197
-180
lines changed

31 files changed

+197
-180
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
!pyproject.toml
77
!poetry.lock
88
!README.md
9-
!install_dependencies.sh
109
!requirements**
10+
!scripts/install_dependencies.sh
1111

1212
# Add code
1313
!src/dipdup/

.github/workflows/build.yml

Lines changed: 32 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,27 @@ jobs:
2323
DOCKER_REGISTRY: ghcr.io
2424
DOCKER_IMAGE_NAME: ${{ github.repository }}
2525

26+
strategy:
27+
matrix:
28+
image:
29+
- name: default
30+
suffix: ''
31+
platforms: linux/amd64,linux/arm64
32+
dockerfile: Dockerfile
33+
build_args: 'PYTEZOS=0'
34+
35+
- name: pytezos
36+
suffix: -pytezos
37+
platforms: linux/amd64,linux/arm64
38+
dockerfile: Dockerfile
39+
build_args: 'PYTEZOS=1'
40+
41+
- name: slim
42+
suffix: -slim
43+
dockerfile: Dockerfile.slim
44+
platforms: linux/amd64,linux/arm64
45+
build_args: ''
46+
2647
steps:
2748
- name: Check out the repo
2849
uses: actions/checkout@v2
@@ -44,75 +65,27 @@ jobs:
4465
username: ${{ github.actor }}
4566
password: ${{ secrets.GITHUB_TOKEN }}
4667

47-
- name: Set up metadata (default)
48-
id: meta-default
49-
uses: docker/metadata-action@v3
50-
with:
51-
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
52-
flavor: |
53-
latest=false
54-
tags: |
55-
type=ref,event=branch
56-
type=ref,event=tag
57-
58-
- name: Set up metadata (pytezos)
59-
id: meta-pytezos
68+
- name: Set up metadata
69+
id: meta
6070
uses: docker/metadata-action@v3
6171
with:
6272
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
6373
flavor: |
6474
latest=false
65-
suffix=-pytezos
75+
suffix={{ matrix.image.suffix }}
6676
tags: |
6777
type=ref,event=branch
6878
type=ref,event=tag
6979
70-
- name: Set up metadata (slim)
71-
id: meta-slim
72-
uses: docker/metadata-action@v3
73-
with:
74-
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
75-
flavor: |
76-
latest=false
77-
suffix=-slim
78-
tags: |
79-
type=ref,event=branch
80-
type=ref,event=tag
81-
82-
- name: Publish nightly image (default)
83-
uses: docker/build-push-action@v3
84-
with:
85-
context: .
86-
file: Dockerfile
87-
platforms: linux/amd64,linux/arm64
88-
push: true
89-
cache-from: type=gha,scope=default
90-
cache-to: type=gha,scope=default,mode=max
91-
tags: ${{ steps.meta-default.outputs.tags }}
92-
labels: ${{ steps.meta-default.outputs.labels }}
93-
build-args: PYTEZOS=0
94-
95-
- name: Publish nightly image (pytezos)
96-
uses: docker/build-push-action@v3
97-
with:
98-
context: .
99-
file: Dockerfile
100-
platforms: linux/amd64,linux/arm64
101-
push: true
102-
cache-from: type=gha,scope=pytezos
103-
cache-to: type=gha,scope=pytezos,mode=max
104-
tags: ${{ steps.meta-pytezos.outputs.tags }}
105-
labels: ${{ steps.meta-pytezos.outputs.labels }}
106-
build-args: PYTEZOS=1
107-
108-
- name: Publish nightly image (slim)
80+
- name: Publish nightly image
10981
uses: docker/build-push-action@v3
11082
with:
11183
context: .
112-
file: Dockerfile.slim
113-
platforms: linux/amd64,linux/arm64
84+
file: ${{ matrix.image.dockerfile }}
85+
platforms: ${{ matrix.image.platforms }}
11486
push: true
115-
cache-from: type=gha,scope=slim
116-
cache-to: type=gha,scope=slim,mode=max
117-
tags: ${{ steps.meta-slim.outputs.tags }}
118-
labels: ${{ steps.meta-slim.outputs.labels }}
87+
cache-from: type=gha,scope={{ matrix.image.name }}
88+
cache-to: type=gha,scope={{ matrix.image.name }},mode=max
89+
tags: ${{ steps.meta.outputs.tags }}
90+
labels: ${{ steps.meta.outputs.labels }}
91+
build-args: ${{ matrix.image.build_args }}

.github/workflows/docs.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
- master
99
paths:
1010
- 'docs/**'
11+
- 'scripts/**'
12+
- ".github/workflows/docs.yml"
1113

1214
jobs:
1315
docs:
@@ -68,4 +70,12 @@ jobs:
6870
with:
6971
github_token: ${{ secrets.GITHUB_TOKEN }}
7072
publish_dir: ./docs/dist/docs
71-
destination_dir: docs-next
73+
destination_dir: docs-next
74+
75+
- name: Deploy scripts to GH Pages
76+
if: startsWith(github.ref, 'refs/heads') || contains(github.ref, '-rc')
77+
uses: peaceiris/actions-gh-pages@v3
78+
with:
79+
github_token: ${{ secrets.GITHUB_TOKEN }}
80+
publish_dir: ./scripts
81+
keep_files: true

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ and this project adheres to [Semantic Versioning].
99

1010
### Added
1111

12-
- ci: Introduced official MacOS support.
1312
- ci: Build `arm64` images for M1/M2 silicon.
1413
- ci: Build `-slim` images based on Alpine Linux.
14+
- ci: Introduced official MacOS support.
15+
- ci: Introduced interactive installer (dipdup.net/install.py).
1516

1617
## [6.0.1] - 2022-08-19
1718

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ WORKDIR /home/dipdup/
5252
ENTRYPOINT ["dipdup"]
5353
CMD ["run"]
5454

55-
COPY --chown=dipdup --chmod=0755 install_dependencies.sh /opt/dipdup/.venv/bin/install_dependencies
56-
COPY --chown=dipdup --chmod=0755 install_dependencies.sh /opt/dipdup/.venv/bin/inject_pyproject
55+
COPY --chown=dipdup --chmod=0755 scripts/install_dependencies.sh /opt/dipdup/.venv/bin/install_dependencies
56+
COPY --chown=dipdup --chmod=0755 scripts/install_dependencies.sh /opt/dipdup/.venv/bin/inject_pyproject
5757
COPY --chown=dipdup --from=compile-image /opt/dipdup /opt/dipdup
5858
COPY --chown=dipdup . /opt/dipdup

Dockerfile.slim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ WORKDIR /home/dipdup/
2020
ENTRYPOINT ["dipdup"]
2121
CMD ["run"]
2222

23-
COPY --chown=dipdup --chmod=0755 install_dependencies.sh /opt/dipdup/bin/install_dependencies
24-
COPY --chown=dipdup --chmod=0755 install_dependencies.sh /opt/dipdup/bin/inject_pyproject
23+
COPY --chown=dipdup --chmod=0755 scripts/install_dependencies.sh /opt/dipdup/bin/install_dependencies
24+
COPY --chown=dipdup --chmod=0755 scripts/install_dependencies.sh /opt/dipdup/bin/inject_pyproject
2525
COPY --chown=dipdup --from=compile-image /opt/dipdup /opt/dipdup
2626
COPY --chown=dipdup . /opt/dipdup

Makefile

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,37 +40,39 @@ homepage: ## Build homepage
4040
##
4141

4242
isort: ## Format with isort
43-
poetry run isort src tests
43+
poetry run isort src tests scripts
4444

4545
black: ## Format with black
46-
poetry run black src tests
46+
poetry run black src tests scripts
4747

4848
flake: ## Lint with flake8
49-
poetry run flakeheaven lint src tests
49+
poetry run flakeheaven lint src tests scripts
5050

5151
mypy: ## Lint with mypy
52-
poetry run mypy src tests
52+
poetry run mypy src tests scripts
5353

5454
cover: ## Print coverage for the current branch
5555
poetry run diff-cover --compare-branch `git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'` coverage.xml
5656

5757
build: ## Build Python wheel package
5858
poetry build
5959

60-
image:
60+
image: ## Build all Docker images
6161
make image-default
6262
make image-pytezos
6363
make image-slim
6464

65-
image-default: ## Build Docker image
65+
image-default: ## Build default Docker image
6666
docker buildx build . --progress plain -t dipdup:${TAG}
6767

68-
image-pytezos:
68+
image-pytezos: ## Build pytezos Docker image
6969
docker buildx build . --progress plain -t dipdup:${TAG}-pytezos --build-arg PYTEZOS=1
7070

71-
image-slim:
71+
image-slim: ## Build slim Docker image
7272
docker buildx build . --progress plain -t dipdup:${TAG}-slim -f Dockerfile.slim
7373

74+
##
75+
7476
release-patch: ## Release patch version
7577
bumpversion patch
7678
git push --tags
@@ -86,21 +88,30 @@ release-major: ## Release major version
8688
git push --tags
8789
git push
8890

91+
##
92+
8993
clean: ## Remove all files from .gitignore except for `.venv`
9094
git clean -xdf --exclude=".venv"
9195

92-
##
93-
94-
requirements: ## Update dependencies, export requirements.txt
96+
update: ## Update dependencies, export requirements.txt (wait an eternity)
9597
make install
9698
poetry update
99+
97100
cp pyproject.toml pyproject.toml.bak
98101
cp poetry.lock poetry.lock.bak
102+
99103
poetry export -o requirements.txt
100104
poetry export -o requirements.pytezos.txt -E pytezos
101105
poetry export -o requirements.dev.txt --dev
106+
102107
poetry remove datamodel-code-generator
103108
poetry export -o requirements.slim.txt
109+
104110
mv pyproject.toml.bak pyproject.toml
105111
mv poetry.lock.bak poetry.lock
112+
106113
make install
114+
115+
scripts/update-demos.sh
116+
117+
##

cookiecutter/cookiecutter.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"timescale/timescaledb:latest-pg13"
1717
],
1818
"hasura_version": [
19-
"hasura/graphql-engine:v2.10.1",
20-
"hasura/graphql-engine:v2.9.0"
19+
"hasura/graphql-engine:v2.11.0",
20+
"hasura/graphql-engine:v2.10.1"
2121
],
2222

2323
"🧹": "Code quality (press enter)",

docs/Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ orphans:
4646
cat SUMMARY.md | grep ".md" > mentioned.tmp
4747
sed -i -E 's@^.*\[(.*)\]\((.*)\).*$$@\2@p' mentioned.tmp
4848
cat mentioned.tmp | uniq | sort -o mentioned.tmp
49-
find . | grep ".md" | grep -v -e "node_modules/" -e " book/" -e "placeholders.md" -e "SUMMARY.md" -e "mdbook-summary" -e "include" | cut -c "3-" | sort -o existing.tmp
49+
find . | grep ".md" | grep -v \
50+
-e "node_modules/" \
51+
-e " book/" \
52+
-e "placeholders.md" \
53+
-e "SUMMARY.md" \
54+
-e "mdbook-summary" \
55+
-e "mdbook-cookiecutter" \
56+
-e "include" \
57+
| cut -c "3-" | sort -o existing.tmp
5058
diff --color mentioned.tmp existing.tmp
5159
rm mentioned.tmp existing.tmp

docs/getting-started/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ We aim to improve cross-platform compatibility in future releases ([issue](https
2626
You can initialize a hello-world project interactively by choosing configuration options in the terminal. The following command will install [`cookiecutter`](https://cookiecutter.readthedocs.io/en/stable/README.html) and create a new project in the current directory.
2727

2828
```shell
29-
sh <(curl https://raw.githubusercontent.com/dipdup-net/dipdup-py/master/install.sh)
29+
python -c "$(curl -sSL https://dipdup.net/install.py)"
3030
```
3131

3232
### Poetry

0 commit comments

Comments
 (0)