Skip to content

Commit 3d16401

Browse files
authored
Merge pull request #7 from microsoft/kkaitepalli/test-push
Create github action for pushing image to docker
2 parents 1c171e5 + b63eabf commit 3d16401

12 files changed

Lines changed: 59 additions & 24 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build and Push to Docker Hub
2+
3+
on:
4+
push:
5+
paths:
6+
- 'environment/local_docker/image_builder/Dockerfile'
7+
- 'environment/local_docker/image_builder/dockerShell.py'
8+
- 'environment/local_docker/image_builder/ShellCommunicator.py'
9+
- '.github/workflows/dockerBuildPush.yml'
10+
branches:
11+
- main
12+
13+
jobs:
14+
build-and-push:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Log in to Docker Hub
22+
uses: docker/login-action@v3
23+
with:
24+
username: ${{ secrets.DOCKERHUB_USERNAME }}
25+
password: ${{ secrets.DOCKERHUB_TOKEN }}
26+
27+
- name: Build and push Docker image
28+
run: |
29+
IMAGE_NAME=${{ secrets.DOCKERHUB_USERNAME }}/shell_server
30+
TAG=${{ github.sha }}
31+
32+
# build with both commit SHA and latest tag
33+
docker build -f environment/local_docker/image_builder/Dockerfile -t $IMAGE_NAME:$TAG -t $IMAGE_NAME:latest .
34+
docker push $IMAGE_NAME:$TAG
35+
docker push $IMAGE_NAME:latest

Environment/Dockerfile

Lines changed: 0 additions & 14 deletions
This file was deleted.

Environment/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
validate_agent_type_and_permission,
2121
validate_agent_type_and_system_prompt,
2222
)
23-
from Environment.LocalDockerEnvironment import LocalDockerEnvironment
23+
from environment.local_docker import LocalDockerEnvironment
2424
from llm.openai_api import OpenAIApi
2525
from tool_definitions.base_tool import BaseTool
2626

Environment/LocalDockerEnvironment.py renamed to environment/local_docker/LocalDockerEnvironment.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ def __init__(
1313
port: int,
1414
folder_to_mount: Optional[str] = None,
1515
permission: Optional[str] = None,
16-
image: str = "kkaitepalliregistry.azurecr.io/shell_server:latest",
17-
16+
image: str = "kavyasree261002/shell_server:latest",
1817
):
1918
if folder_to_mount is None and permission is not None:
2019
raise ValueError("permission provided but folder_to_mount is None")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .LocalDockerEnvironment import LocalDockerEnvironment
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM mcr.microsoft.com/devcontainers/python:3.11
2+
3+
WORKDIR /app
4+
5+
# Install required runtime dependencies
6+
RUN pip install --no-cache-dir fastapi uvicorn pydantic
7+
8+
# Copy application files
9+
COPY environment/local_docker/image_builder/dockerShell.py .
10+
COPY environment/local_docker/image_builder/ShellCommunicator.py .
11+
12+
EXPOSE 8080
13+
14+
CMD ["python", "dockerShell.py"]

Environment/ShellCommunicator.py renamed to environment/local_docker/image_builder/ShellCommunicator.py

File renamed without changes.

Environment/docker_shell.py renamed to environment/local_docker/image_builder/dockerShell.py

File renamed without changes.

0 commit comments

Comments
 (0)