Skip to content

Commit

Permalink
Merge upstream and develop Chai-1
Browse files Browse the repository at this point in the history
Merge upstream and develop Chai-1 to use the same Dockerfile with
multiple channels
  • Loading branch information
Liana64 committed Dec 17, 2024
1 parent d5e4b52 commit 5419d26
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 144 deletions.
77 changes: 0 additions & 77 deletions apps/chai-amelie/Dockerfile

This file was deleted.

18 changes: 0 additions & 18 deletions apps/chai-amelie/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions apps/chai-amelie/ci/goss.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions apps/chai-amelie/ci/latest.sh

This file was deleted.

23 changes: 0 additions & 23 deletions apps/chai-amelie/entrypoint.sh

This file was deleted.

11 changes: 0 additions & 11 deletions apps/chai-amelie/metadata.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions apps/chai/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,24 @@ RUN \
# -----------------------------------
# libibverbs1 librdmacm1 \
# -----------------------------------
&& \
case "${CHANNEL}" in \
'stable') \
&& curl -fsSL -o /tmp/app.zip "https://github.com/chaidiscovery/chai-lab/archive/refs/tags/v${VERSION}.zip" \
&& unzip -q /tmp/app.zip -d /tmp/app \
&& cp -R /tmp/app/chai-lab-${VERSION}/LICENSE /app \
&& cp -R /tmp/app/chai-lab-${VERSION}/assets /app \
&& cp -R /tmp/app/chai-lab-${VERSION}/examples /app \
&& cp -R /tmp/app/chai-lab-${VERSION}/tests /app \
;; \
'develop') \
&& git clone https://github.com/amelie-iska/chai-lab.git /tmp/chai \
&& cp -R /tmp/chai/LICENSE /app \
&& cp -R /tmp/chai/assets /app \
&& cp -R /tmp/chai/examples /app \
&& cp -R /tmp/chai/tests /app \
;; \
esac \
&& printf "UpdateMethod=docker\nBranch=master\nPackageVersion=%s\nPackageAuthor=[RareCompute](https://github.com/RareCompute)\n" "${VERSION}" > /app/package_info \
&& chown -R ${UID}:${GID} /app && chmod -R 755 /app \
&& curl -LsSf https://astral.sh/uv/0.5.6/install.sh | sh \
Expand Down
16 changes: 15 additions & 1 deletion apps/chai/ci/latest.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/usr/bin/env bash
version=$(curl -sX GET "https://api.github.com/repos/chaidiscovery/chai-lab/releases/latest" | jq --raw-output '.tag_name' 2>/dev/null)
channel=$1

if [[ "${channel}" == "stable" ]]; then
version=$(curl -sX GET "https://api.github.com/repos/chaidiscovery/chai-lab/releases/latest" | jq --raw-output '.tag_name' 2>/dev/null)
fi

if [[ "${channel}" == "develop" ]]; then
git clone --quiet https://github.com/amelie-iska/chai-lab.git /tmp/chai
pushd /tmp/chai > /dev/null || exit
version=$(git rev-list --count --first-parent HEAD)
popd > /dev/null || exit
rm -rf /tmp/chai
fi

version="${version#*v}"
version="${version#*release-}"

printf "%s" "${version}"
6 changes: 6 additions & 0 deletions apps/chai/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ channels:
tests:
enabled: false
type: cli
- name: develop
platforms: ["linux/amd64"]
stable: false
tests:
enabled: false
type: cli

0 comments on commit 5419d26

Please sign in to comment.