-
Notifications
You must be signed in to change notification settings - Fork 1
Add daily platform build of artifacts #40
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
Closed
Closed
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
b9d17b4
add docker-image-shipping repo
brunos252 115d74d
remove leftover deb file
brunos252 df6b074
add note about Lab
brunos252 9ac8234
some comments from previous PR
brunos252 02a7c25
comments
brunos252 6336548
Add gitignore
Josipmrden dabddb4
Reorder build scripts and fix README
Josipmrden e086426
Add daily platform build script
Josipmrden f711e57
Ommit ./ in cd
Josipmrden 8bdb379
Ommit sudo
Josipmrden 0c2d47b
Add manual building of memgraph deb image
Josipmrden e569c6b
Add manual scripts of generating deb file with scripts for mage and p…
Josipmrden 2664731
Add platform build
Josipmrden e634e06
Add output directory
Josipmrden 29fc105
Add building of mgconsole
Josipmrden 012deb5
Add print
Josipmrden dee7fbd
Add upload of artifacts
Josipmrden 44cb430
Add upload of artifacts
Josipmrden b40f869
Fix spaces
Josipmrden 16b8ca3
Add cleanup
Josipmrden 29e0550
Ommit cleanup
Josipmrden 66831a2
Add daily-deb naming
Josipmrden b67b9e8
Setting up python
Josipmrden fcfb137
Ommit setting up python
Josipmrden 02b09ed
Added pruning of docker cache
Josipmrden cd554d9
Solve continued input from pruning of cache
Josipmrden ff29659
Add no cache
Josipmrden ce6b544
Added ubuntu to list of runners
Josipmrden f42914a
Add building deb of the whole package
Josipmrden 6208e7b
Ommit building mage image and platform image
Josipmrden 9ab5539
Merge with main
MarkoBarisic 107c78a
Add arm build for memgraph
MarkoBarisic bb5c349
Fix mistake in job name
MarkoBarisic 318b1c1
Fix artifact path
MarkoBarisic 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 hidden or 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,46 @@ | ||
| name: Daily Platform Build | ||
|
|
||
| on: [pull_request, workflow_dispatch] | ||
|
|
||
| jobs: | ||
| build_memgraph: | ||
| name: "Build memgraph Debian 11" | ||
| runs-on: [self-hosted, DockerMgBuild, X64] | ||
| timeout-minutes: 60 | ||
| steps: | ||
| - name: "Set up repository" | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 # Required because of release/get_version.py | ||
| token: ${{ secrets.PAT }} | ||
| - name: "Build package" | ||
| run: | | ||
| git clone -b master https://github.com/memgraph/memgraph.git | ||
| cd memgraph | ||
| ./release/package/run.sh package debian-11 Release | ||
| - name: "Upload package" | ||
| uses: actions/upload-artifact@v3 | ||
| with: | ||
| name: memgraph-debian-11 | ||
| path: memgraph/build/output/debian-11/memgraph*.deb | ||
|
|
||
| build_memgraph_arm: | ||
| name: "Build memgraph Debian 11 ARM" | ||
| runs-on: [self-hosted, DockerMgBuild, ARM64, strange] | ||
| timeout-minutes: 120 | ||
| steps: | ||
| - name: "Set up repository" | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 # Required because of release/get_version.py | ||
| token: ${{ secrets.PAT }} | ||
| - name: "Build package" | ||
| run: | | ||
| git clone -b master https://github.com/memgraph/memgraph.git | ||
| cd memgraph | ||
| ./release/package/run.sh package debian-11-arm Release | ||
| - name: "Upload package" | ||
| uses: actions/upload-artifact@v3 | ||
| with: | ||
| name: memgraph-debian-aarch64 | ||
| path: memgraph/build/output/debian-11-arm/memgraph*.deb |
This file contains hidden or 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,79 @@ | ||
| name: Daily Platform Build | ||
|
|
||
| # on: [pull_request, workflow_dispatch] | ||
| on: [workflow_dispatch] | ||
|
|
||
| jobs: | ||
| artifacts_build: | ||
| name: "Build artifacts" | ||
| runs-on: [self-hosted, Linux, X64, Diff, Ubuntu20.04] | ||
| env: | ||
| THREADS: 24 | ||
| PY_VERSION: "3.9" | ||
|
|
||
| steps: | ||
| - name: Set up repository | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| # Number of commits to fetch. `0` indicates all history for all | ||
| # branches and tags. (default: 1) | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.PAT }} | ||
|
|
||
| - name: Build community binaries | ||
| run: | | ||
| git clone -b master https://github.com/memgraph/memgraph.git | ||
|
|
||
| cd memgraph | ||
|
|
||
| # Activate toolchain. | ||
| source /opt/toolchain-v4/activate | ||
|
|
||
| # Initialize dependencies. | ||
| ./init | ||
|
|
||
| # Build community binaries. | ||
| cd build | ||
| cmake -DCMAKE_BUILD_TYPE=release -DMG_ENTERPRISE=OFF .. | ||
| make -j$THREADS && make -j$THREADS mgconsole | ||
|
|
||
| mkdir -p output | ||
| cd output | ||
|
|
||
| cpack -G DEB --config "../CPackConfig.cmake" | ||
|
|
||
| cd ../../../ | ||
|
|
||
| mkdir -p scripts/resources | ||
|
|
||
| find memgraph/build/output -type f -name "*.deb" -exec mv -f {} scripts/resources/memgraph-daily-deb_amd64.deb \; | ||
|
|
||
| rm -rf memgraph | ||
|
|
||
| - name: "Upload DEB" | ||
| uses: actions/upload-artifact@v3 | ||
| with: | ||
| name: daily-deb | ||
| path: scripts/resources/memgraph*.deb | ||
|
|
||
| # - name: Build MAGE image | ||
| # run: | | ||
| # cd scripts | ||
|
|
||
| # ./build_mage_img.sh main daily-mage daily-deb | ||
|
|
||
| # - name: "Upload MAGE image" | ||
| # uses: actions/upload-artifact@v3 | ||
| # with: | ||
| # name: daily-mage | ||
| # path: resources/daily-mage.tar.gz | ||
|
|
||
| # - name: Build platform image | ||
| # run: | | ||
| # ./build_platform_img.sh master daily-platform daily-deb ${{ secrets.PAT }} | ||
|
|
||
| # - name: "Upload platform image" | ||
| # uses: actions/upload-artifact@v3 | ||
| # with: | ||
| # name: daily-platform | ||
| # path: resources/daily-platform.tar.gz | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| scripts/resources | ||
| scripts/dist | ||
| *.deb |
This file contains hidden or 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
This file contains hidden or 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,17 @@ | ||
| #!/bin/bash | ||
|
|
||
| git config --global --add safe.directory /memgraph | ||
|
|
||
| source /opt/toolchain-v4/activate | ||
|
|
||
| cd memgraph | ||
| ./environment/os/debian-11.sh install MEMGRAPH_BUILD_DEPS | ||
| ./init | ||
|
|
||
| mkdir -p build | ||
| cd build | ||
|
|
||
| cmake -DCMAKE_BUILD_TYPE=Release .. && make -j4 memgraph && make -j4 mgconsole | ||
|
|
||
| cd output | ||
| cpack -G DEB --config "../CPackConfig.cmake" |
This file contains hidden or 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,28 @@ | ||
| #!/bin/bash | ||
|
|
||
| CURR_DIR="$PWD" | ||
| MEMGRAPH_DIR="$CURR_DIR/memgraph" | ||
|
|
||
| cloned=true | ||
| branch_name=$1 | ||
| deb_name=$2 | ||
|
|
||
| git clone -b $branch_name https://github.com/memgraph/memgraph.git | ||
|
|
||
| mkdir -p resources | ||
|
|
||
| docker pull memgraph/memgraph-builder | ||
| docker stop meme-build || true && docker rm meme-build || true | ||
|
|
||
| docker run --name meme-build -itd -v $MEMGRAPH_DIR:/memgraph -v $CURR_DIR/resources/output:/memgraph/build/output --entrypoint bash memgraph/memgraph-builder | ||
| docker exec -i meme-build bash < $CURR_DIR/_build_mg.sh | ||
| docker stop meme-build | ||
| docker rm meme-build | ||
|
|
||
| find $CURR_DIR/resources/output -type f -name "*.deb" -exec mv -f {} resources/memgraph-${deb_name}_amd64.deb \; | ||
|
|
||
| if $cloned;then | ||
| rm -rf $MEMGRAPH_DIR | ||
| fi | ||
| rm -rf $CURR_DIR/resources/output | ||
|
|
This file contains hidden or 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,24 @@ | ||
| #!/bin/bash | ||
|
|
||
| CURR_DIR="$PWD" | ||
| MAGE_DIR="$CURR_DIR/mage" | ||
|
|
||
| branch=$1 | ||
| image_name=$2 | ||
| deb_name=$3 | ||
|
|
||
| git clone --recurse-submodules -b $1 https://github.com/memgraph/mage.git | ||
|
|
||
| cp "${CURR_DIR}/resources/memgraph-${deb_name}_amd64.deb" "${MAGE_DIR}/memgraph-${deb_name}_amd64.deb" | ||
|
|
||
| cd ${MAGE_DIR} | ||
|
|
||
| docker buildx build --no-cache --target prod --platform=linux/amd64 -t ${image_name} --build-arg TARGETARCH=${deb_name}_amd64 -f ${MAGE_DIR}/Dockerfile.release . | ||
|
|
||
| cd ${CURR_DIR} | ||
|
|
||
| docker save ${image_name} | gzip -f > "${CURR_DIR}/resources/${image_name}.tar.gz" | ||
| docker rmi ${image_name} | ||
|
|
||
| rm -rf ${image_name} | ||
| rm -rf ${MAGE_DIR} |
This file contains hidden or 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,32 @@ | ||
| #!/bin/bash | ||
|
|
||
| CURR_DIR="$PWD" | ||
| PLATFORM_DIR="${CURR_DIR}/memgraph-platform" | ||
|
|
||
| branch=$1 | ||
| image_name=$2 | ||
| target_arch=$3 | ||
| token=$4 | ||
| memgraph_and_lab=${5-false} | ||
|
|
||
| git clone --recurse-submodules -b $1 https://github.com/memgraph/memgraph-platform.git | ||
|
|
||
| cp "${CURR_DIR}/resources/memgraph-${target_arch}_amd64.deb" "${PLATFORM_DIR}/memgraph-${target_arch}_amd64.deb" | ||
| cd ${PLATFORM_DIR} | ||
|
|
||
| dockerfile=${PLATFORM_DIR}/Dockerfile | ||
|
|
||
| if [ "${memgraph_and_lab}" == true ]; | ||
| then | ||
| dockerfile = ${PLATFORM_DIR}/memgraph_and_lab.Dockerfile | ||
| fi | ||
|
|
||
| docker buildx build --platform=linux/amd64 -t ${image_name} --build-arg TARGETARCH=${target_arch}_amd64 --build-arg NPM_PACKAGE_TOKEN=${token} -f ${dockerfile} . | ||
|
|
||
| cd ${CURR_DIR} | ||
|
|
||
| docker save ${image_name} | gzip -f > "${CURR_DIR}/resources/${image_name}.tar.gz" | ||
| docker rmi ${image_name} | ||
|
|
||
| rm -rf ${image_name} | ||
| rm -rf ${PLATFORM_DIR} |
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.
Uh oh!
There was an error while loading. Please reload this page.