Skip to content

Commit 75e3ce1

Browse files
authored
Merge pull request #253 from davidycliao/0.0.7
2 parents 18a5353 + fa0c988 commit 75e3ce1

File tree

3 files changed

+21
-44
lines changed

3 files changed

+21
-44
lines changed

.github/workflows/docker-publish.yml

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,8 @@ on:
88

99
jobs:
1010
R-CMD-check:
11-
runs-on: ${{ matrix.config.os }}
12-
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
13-
strategy:
14-
fail-fast: false
15-
matrix:
16-
config:
17-
- {os: ubuntu-latest, r: 'release'}
11+
runs-on: ubuntu-latest
12+
name: R-CMD-check
1813
env:
1914
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
2015
R_KEEP_PKG_SOURCE: yes
@@ -23,8 +18,6 @@ jobs:
2318

2419
- uses: r-lib/actions/setup-r@v2
2520
with:
26-
r-version: ${{ matrix.config.r }}
27-
http-user-agent: ${{ matrix.config.http-user-agent }}
2821
use-public-rspm: true
2922

3023
- uses: r-lib/actions/setup-pandoc@v2
@@ -34,9 +27,6 @@ jobs:
3427
with:
3528
python-version: '3.9'
3629

37-
- name: Check Python Version
38-
run: python --version
39-
4030
- name: Install Python dependencies
4131
run: |
4232
python -m pip install --upgrade pip
@@ -61,34 +51,26 @@ jobs:
6151
steps:
6252
- uses: actions/checkout@v3
6353

64-
- name: Set up QEMU
65-
uses: docker/setup-qemu-action@v3
66-
67-
- name: Set up Docker Buildx
68-
uses: docker/setup-buildx-action@v2
69-
7054
- name: Log in to GitHub Container Registry
7155
uses: docker/login-action@v2
7256
with:
7357
registry: ghcr.io
7458
username: ${{ github.actor }}
7559
password: ${{ secrets.GITHUB_TOKEN }}
7660

61+
- name: Set up Docker Buildx
62+
uses: docker/setup-buildx-action@v2
63+
7764
- name: Build and push Docker image
7865
uses: docker/build-push-action@v4
7966
with:
8067
context: .
81-
platforms: linux/arm64
8268
push: true
8369
tags: |
8470
ghcr.io/${{ github.repository_owner }}/flair:latest
8571
ghcr.io/${{ github.repository_owner }}/flair:${{ github.sha }}
8672
labels: |
8773
org.opencontainers.image.title=flaiR
88-
org.opencontainers.image.description=An R Docker Image for Natural Language Processing with Flair. Includes R, Python with Flair NLP library, and text analysis dependencies.
89-
org.opencontainers.image.vendor=davidycliao
9074
org.opencontainers.image.version=0.0.7
91-
annotations: |
92-
org.opencontainers.image.description=An R Docker Image for Natural Language Processing with Flair. This image includes R, Python with Flair NLP library, and essential dependencies for text analysis. Supports both standard NER and OntoNotes models, with batch processing capabilities.
9375
cache-from: type=gha
9476
cache-to: type=gha,mode=max

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ files/directories
1010
^tmp.*
1111
vignettes/vignettes/inst
1212
classifier
13-
/R/note.R
13+
.DS_Store

Dockerfile

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,31 @@
11
FROM r-base:latest
22
LABEL maintainer="Yen-Chieh Liao <davidycliao@gmail.com>"
3-
LABEL org.opencontainers.image.description="flaiR: An R Docker Image for Natural Language Processing with Flair. This image includes R, Python with Flair NLP library, and essential dependencies for text analysis. Supports both standard NER and OntoNotes models, with batch processing capabilities."
4-
53

4+
# dependencies
65
RUN apt-get update && apt-get install -y \
76
python3 \
87
python3-pip \
98
python3-venv \
109
python3-full \
1110
libcurl4-openssl-dev \
1211
libssl-dev \
13-
libxml2-dev
14-
15-
# 創建虛擬環境
12+
libxml2-dev \
13+
libfontconfig1-dev \
14+
libharfbuzz-dev \
15+
libfribidi-dev \
16+
libfreetype6-dev \
17+
libpng-dev \
18+
libtiff5-dev \
19+
libjpeg-dev
20+
21+
# creation of env
1622
RUN python3 -m venv /opt/venv
1723

18-
# 在虛擬環境中安裝 Flair
24+
# Flair
1925
RUN /opt/venv/bin/pip install flair
2026

21-
# 安裝 R 依賴項 和 flaiR 包
22-
RUN R -e "install.packages(c('remotes', \
23-
'data.table', 'reticulate', 'curl', 'attempt', 'htmltools', 'stringr', \
24-
'knitr', 'rmarkdown', 'lsa', 'purrr', 'jsonlite', 'ggplot2', 'plotly', 'testthat'), \
25-
repos='https://cloud.r-project.org/')" && \
26-
R -e "remotes::install_github('davidycliao/flaiR', force = TRUE)"
27-
28-
# 複製你的 R 包源碼到容器中
29-
COPY . /pkg
30-
WORKDIR /pkg
31-
32-
# 從本地安裝套件(如果需要)
33-
# RUN R -e "remotes::install_local('/pkg', force = TRUE)" # 注释掉这行,因为我们已经从 GitHub 安装了
27+
# CRAN mirror
28+
RUN R -e "install.packages(c('remotes', 'reticulate'))" && \
29+
R -e "remotes::install_github('davidycliao/flaiR', dependencies = FALSE)"
3430

35-
# 設定預設命令
3631
CMD ["R"]

0 commit comments

Comments
 (0)