Skip to content

Commit

Permalink
updated workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyaven committed Oct 24, 2023
1 parent 8fa92e3 commit c0b29f8
Show file tree
Hide file tree
Showing 8 changed files with 181 additions and 23 deletions.
22 changes: 0 additions & 22 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +0,0 @@
FROM stackql/stackql:latest AS stackql
FROM mcr.microsoft.com/devcontainers/universal:2
COPY --from=stackql /srv/stackql/stackql /usr/local/bin/stackql
# set up matplotlib temp dir
RUN mkdir -p /tmp/matplotlib
RUN chmod 777 /tmp/matplotlib
ENV MPLCONFIGDIR=/tmp/matplotlib
ENV PYDEVD_DISABLE_FILE_VALIDATION=1
ENV PYTHON_PACKAGES="\
pystackql \
matplotlib \
pandas \
mplfinance \
psycopg2-binary \
nest_asyncio \
plotly \
ipytree \
nbformat \
networkx \
"
RUN pip install --upgrade pip \
&& pip install --no-cache-dir $PYTHON_PACKAGES
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: '[BUG]'
labels: 'bug'
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE]"
labels: enhancement
assignees: ''

---

**Feature Description**
A clear and concise description of what you want to happen.

**Example(s)**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Possible Approaches or Libraries to Consider**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Question
about: Pose a question to the StackQL team
title: "[QUESTION]"
labels: question
assignees: ''

---


## Question

This channel is an opportunity to ask ad-hoc questions to the `stackql` team. This channel is in lieu of an official platform for ongoing discussions and questions. Please ask your question :)

**Note**: Questions over github issues will be deprecated and retired once we settle on a platform / process ongoing.
37 changes: 37 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build and Publish

on:
push:
branches: [main]
pull_request:

jobs:
build-and-push-docker-image:
name: Build Docker image and push to repositories
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build image and push to Docker Hub and GitHub Container Registry
uses: docker/build-push-action@v2
with:
context: .
tags: |
stackql/stackql-codespaces-base:latest
stackql/stackql-codespaces-base:${{github.sha}}
# build on feature branches, push only on main branch
push: ${{ github.ref == 'refs/heads/main' }}

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# dev container image for GitHub Codespaces
FROM stackql/stackql:latest AS stackql
FROM mcr.microsoft.com/devcontainers/universal:2
COPY --from=stackql /srv/stackql/stackql /usr/local/bin/stackql
# set up matplotlib temp dir
RUN mkdir -p /tmp/matplotlib
RUN chmod 777 /tmp/matplotlib
ENV MPLCONFIGDIR=/tmp/matplotlib
ENV PYDEVD_DISABLE_FILE_VALIDATION=1
ENV PYTHON_PACKAGES="\
pystackql \
matplotlib \
pandas \
mplfinance \
psycopg2-binary \
nest_asyncio \
plotly \
ipytree \
nbformat \
networkx \
"
RUN pip install --upgrade pip \
&& pip install --no-cache-dir $PYTHON_PACKAGES
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[![StackQL](https://stackql.io/img/stackql-logo-bold.png)](https://stackql.io/)
<br />
[![GitHub Actions](https://github.com/stackql/stackql-codespaces-notebook/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/stackql/stackql-codespaces-notebook/actions/workflows/main.yml)
![License](https://img.shields.io/github/license/stackql/stackql)

# stackql-codespaces-notebook

42 changes: 41 additions & 1 deletion notebooks/github.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
"%load_ext pystackql.magic"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%stackql registry pull github"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -19,7 +28,16 @@
},
"outputs": [],
"source": [
"org = \"stackql\""
"org = \"stackql\"\n",
"owner = \"stackql\"\n",
"repo = \"stackql\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Stargazers per Repo"
]
},
{
Expand Down Expand Up @@ -47,6 +65,28 @@
"source": [
"_.plot(kind='bar', title='Stargazers', x='name', y='stargazers_count')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Repo Contributors who Arent Stargazers"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%stackql\n",
"SELECT c.login as contrtibutor FROM \n",
"github.repos.contributors c\n",
"LEFT OUTER JOIN github.activity.repo_stargazers s\n",
"ON s.login = c.login\n",
"WHERE owner = '$owner' AND repo = '$repo'\n",
"AND s.login IS NULL"
]
}
],
"metadata": {
Expand Down

0 comments on commit c0b29f8

Please sign in to comment.