-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
86 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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,4 +1,4 @@ | ||
name: JLAI-CI | ||
name: CI/CD | ||
|
||
on: | ||
push: | ||
|
This file contains 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,4 +1,4 @@ | ||
name: JLAI-CI | ||
name: CI/CD | ||
|
||
on: | ||
push: | ||
|
This file contains 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,4 +1,4 @@ | ||
name: JLAI-CI | ||
name: CI/CD | ||
|
||
on: | ||
push: | ||
|
This file contains 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,44 @@ | ||
name: CI/CD | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'Codes/Julia/**' | ||
- 'Docker/**' | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- | ||
name: Build and push Docker images | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
file: ./Docker/Dockerfile | ||
# platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/jlai:latest | ||
- | ||
name: Docker Hub Description | ||
uses: peter-evans/dockerhub-description@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
repository: ${{ secrets.DOCKER_HUB_USERNAME }}/jlai | ||
|
This file contains 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,38 @@ | ||
FROM julia:1.10.0 | ||
LABEL author="A. Mhamdi <[email protected]>" | ||
|
||
# Expose ports | ||
EXPOSE 1234 2468 | ||
|
||
# Set ENV variables | ||
ENV USERNAME mhamdi | ||
ENV USER_HOME_DIR /home/${USERNAME} | ||
ENV JULIA_DEPOT_PATH ${USER_HOME_DIR}/.julia | ||
ENV JL ${JULIA_DEPOT_PATH}/conda/3/bin/jupyter\ lab | ||
ARG WORKING_DIR="${USER_HOME_DIR}/work/" | ||
|
||
# Add user and set ownership | ||
RUN useradd -ms /bin/bash -p $(echo ${USERNAME} | openssl passwd -1 -stdin) ${USERNAME} | ||
|
||
# Change user & working directory | ||
USER ${USERNAME} | ||
WORKDIR "${USER_HOME_DIR}" | ||
# Copy needed files and datasets | ||
RUN mkdir -p "${WORKING_DIR}" | ||
# Change working directory | ||
WORKDIR "${WORKING_DIR}" | ||
|
||
# Copy datasets | ||
COPY ./Codes/Julia/Datasets ./datasets/ | ||
|
||
# Copy TOML files (deps, ver, pkg, UUID) | ||
COPY ./Codes/Julia/Project.toml ./ | ||
# COPY ./Codes/Julia/Manifest.toml ./ | ||
|
||
# Activate environment and add IJulia kernel, Pluto and JupyterLab IDE | ||
RUN julia -e 'import Pkg; Pkg.activate("."); Pkg.instantiate(); Pkg.precompile()' | ||
RUN julia -e 'import Pkg; Pkg.add(["Conda", "IJulia", "Pluto"]); Pkg.precompile()' | ||
RUN julia -e 'import Conda; Conda.add("JupyterLab")' | ||
|
||
# Default command | ||
CMD julia |
This file contains 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