Skip to content

Commit

Permalink
fix some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mhamdi committed Jan 11, 2024
1 parent daddab7 commit 827c1ed
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/jlai-p1.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: JLAI-CI
name: CI/CD

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jlai-p2.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: JLAI-CI
name: CI/CD

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jlai-p3.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: JLAI-CI
name: CI/CD

on:
push:
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/jlai.yml
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

38 changes: 38 additions & 0 deletions Docker/Dockerfile
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This repository contains slides, labs and code examples for using `Julia` to implement some **artificial intelligence** related algorithms. Codes run on top of a `Docker` image, ensuring a consistent and reproducible environment.

[![JLAI CI](https://github.com/a-mhamdi/jlai/actions/workflows/docker-image.yml/badge.svg)](https://github.com/a-mhamdi/jlai/actions/workflows/docker-image.yml)
[![JLAI CI](https://github.com/a-mhamdi/jlai/actions/workflows/docker-image.yml/badge.svg)](https://github.com/a-mhamdi/jlai/actions/workflows/jlai.yml)
[![Docker Version](https://img.shields.io/docker/v/abmhamdi/jlai?sort=semver)](https://hub.docker.com/r/abmhamdi/jlai)
[![Docker Pulls](https://img.shields.io/docker/pulls/abmhamdi/jlai)](https://hub.docker.com/r/abmhamdi/jlai)
[![Docker Stars](https://img.shields.io/docker/stars/abmhamdi/jlai)](https://hub.docker.com/r/abmhamdi/jlai)
Expand Down

0 comments on commit 827c1ed

Please sign in to comment.