Skip to content

Commit

Permalink
Merge pull request #8 from UBC-DSCI/feat-env
Browse files Browse the repository at this point in the history
Feat: environment for development and reproducibility
  • Loading branch information
mds-octocat authored Feb 17, 2022
2 parents 6d80f6c + 46eea7e commit 0f60933
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Dockerfile on DockerHub
on:
push:
branches:
- main
paths:
- 'Dockerfile'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: '0'
- name: Bump version and push tag
uses: anothrNick/github-tag-action@1.33.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
RELEASE_BRANCHES: main
id: bump
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.bump.outputs.new_tag }}
release_name: ${{ steps.bump.outputs.new_tag }}
body: |
Changes in this Release
- Rebuilt Docker image and published to DockerHub with new tag
draft: false
prerelease: false
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: ubcdsci/predict-airbnb # change this to your DockerHub username and repository
username: ${{ secrets.DOCKER_USERNAME }} # you need to add your Docker username to this GitHub repo as a secret
password: ${{ secrets.DOCKER_PASSWORD }} # you need to add your Docker password to this GitHub repo as a secret
tags: "latest,${{ steps.bump.outputs.new_tag }}"
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM ubcdsci/jupyterlab:v0.9.0

# Install R packages with specific versions from conda-forge
# Packages and versions specified in environment.yml
COPY environment.yml .
RUN conda env update --file environment.yml
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
# predict-airbnb-nightly-price
# Predict Airbnb nightly price

## Usage

We use a Docker container image to make the computational environment for this project reproducible.
To run Jupyter lab inside the `ubcdsci/predict-airbnb` Docker container:

- in terminal, navigate to the root of this project repository
- type the following in terminal:

```
docker-compose up -d
```
- once the container has launched, users need to copy the URL that looks like `http://127.0.0.1:8888/lab?token=d9704724bf0267d3d9262698ffbb88123633f8c8f4b1a305` into their web browser to access Jupyter Lab
- when done working, type `docker-compose down` to remove the dangling container.

7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:
airbnb-env:
image: ubcdsci/predict-airbnb
ports:
- "8888:8888"
volumes:
- .:/opt/notebooks/predict-airbnb-nightly-price
14 changes: 14 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: base
channels:
- conda-forge
dependencies:
- r-cowplot=1.1.1
- r-devtools=2.4.3
- r-kknn=1.3.1
- r-scales=1.1.1
- r-testthat=3.1.2
- r-tidymodels=0.1.4
- r-tidyverse=1.3.1
- r-tinytex=0.37
- r-usethis=2.1.5
- unixodbc=2.3.9

0 comments on commit 0f60933

Please sign in to comment.