jpark2111
(Jea Hyun Park)
January 26, 2022, 6:42pm
1
This is my yml file under workflows folder
name: Action Server
on:
push:
branches:
- 'main'
paths:
- 'actions/**'
jobs:
build_and_deploy:
runs-on: ubuntu-20.04
name: Build Action Server image and upgrade Rasa X deployment
steps:
- name: Checkout repository
uses: actions/checkout@v2
- id: action_server
name: Build an action server with a custom actions
uses: RasaHQ/action-server-gha@main
with:
actions_directory: ./actions
requirements_file: ./actions/requirements-actions.txt
docker_registry_login: ${{ secrets.DOCKER_HUB_LOGIN }}
docker_registry_password: ${{ secrets.DOCKER_HUB_PASSWORD }}
docker_image_name: 'jpark2111/wealthbuild_rasa_action_server'
docker_image_tag: ${{ github.sha }}
docker_registry_push: true
dockerfile: Dockerfile
I got error as below,
I’m using docker hub credential, what parameter should be changed or added to yml file? What docker registry should I use? tried docker.io , hub.docker.com but no luck. I’m new to docker and github action Any help would be appreciated!
nik202
(NiK202)
January 26, 2022, 6:45pm
2
@jpark2111 Sure, nothing to worry
Can I suggest some changes, if you allow me?
Always mention me with @ nik202
jpark2111
(Jea Hyun Park)
January 26, 2022, 6:53pm
3
Sure @nik202 what is a suggestion?
nik202
(NiK202)
January 26, 2022, 7:22pm
4
@jpark2111
I hope you have mentioned the DOCKER_HUB_LOGIN and DOCKER_HUB_PASSWORD secrets key inside Actions on Github? Details of this link: Docker Hub
Can you change the docker_image_tag: ${{ github.sha }}
to docker_image_tag: 'latest'
It’s easy to use as SHA has a long sequence of ASCI characters Digest.
Can we make a DockerHub registry private?
Can you change this runs-on: ubuntu-20.04
to runs-on: ubuntu-latest
Is your requirements-actions.txt
is similar to what you mentioned in the actions folder?
Ref: helpdesk-assistant/continuous-integration.yml at main · RasaHQ/helpdesk-assistant · GitHub
Please follow this and you will be able to push actions_server image to docker hub.
Good Luck! If you have any doubt do let me know.
jpark2111
(Jea Hyun Park)
January 26, 2022, 8:04pm
5
Yeah I added DOCKER_HUB_LOGIN and DOCKER_HUB_PASSWORD secrets key inside Actions on my Github page
changed to ‘latest’
I made my docker repo private
changed to ubuntu-latest
requirements-actions.txt is in actions folder
still getting same error
Login to the docker.io registry.
Error response from daemon: Get "https://registry-1.docker.io/v2/": unauthorized: incorrect username or password
Error: Process completed with exit code 1.
nik202
(NiK202)
January 26, 2022, 8:06pm
6
@jpark2111 delete the DOCKER_HUB_LOGIN and DOCKER_HUB_PASSWORD secrets key and do it again it’s only the issue of login and password.
On Github:
Above output, you are getting in actions on Github actions?
jpark2111
(Jea Hyun Park)
January 26, 2022, 8:51pm
7
I removed it and added them again. this is a right place to add secrets right? still getting same error @nik202
nik202
(NiK202)
January 26, 2022, 8:53pm
8
@jpark2111 can you share Dockerfile and it’s in the actions folder or outside?
jpark2111
(Jea Hyun Park)
January 26, 2022, 9:08pm
9
I have dockerfile outside of actions folder,
sharing Dockerfile
FROM rasa/rasa-sdk:2.8.2
WORKDIR /app
COPY actions /app/actions
USER root
RUN pip install --no-cache-dir -r /app/actions/requirements-actions.txt
USER 1001
CMD ["start", "--actions", "actions"]
nik202
(NiK202)
January 26, 2022, 11:50pm
10
@jpark2111 please put the Dockerfile inside actions folder and mentioned the path in actions.yml
name: Action Server
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
paths:
- 'actions/**'
- '.github/workflows/action_server.yml'
jobs:
build_and_deploy:
runs-on: ubuntu-latest
name: Build and push Action Server Image
steps:
- name: Checkout repository
uses: actions/checkout@v2
- id: action_server
name: Build an action server with a custom actions
uses: RasaHQ/action-server-gha@main
# Full list of parameters: https://github.com/RasaHQ/action-server-gha/tree/main#input-arguments
with:
actions_directory: './actions'
requirements_file: 'actions/requirements.txt'
docker_image_name: 'rasa/action_server'
docker_registry_login: ${{ secrets.DOCKERHUB_LOGIN }}
docker_registry_password: ${{ secrets.DOCKERHUB_PASSWORD }}
docker_image_tag: 'actionserver'
dockerfile: 'actions/Dockerfile'
If the issue of unauthorized comes again, then you are not putting the username or password correctly in secret keys.
Thanks.
jpark2111
(Jea Hyun Park)
January 27, 2022, 1:16am
11
ahh it was credential problem… it didn’t let me use the email that I’ve been using to log in to docker hub
Solved! Thank you @nik202
jpark2111
(Jea Hyun Park)
January 27, 2022, 5:32am
12
One more question. I was able to build action server image with github actions, but once I use the image rasa x can’t talk to action server so that custom action doesn’t get triggered. But when I use the image I built in local and pushed, rasa x can talk to it. What’s the possibility that the image built by github action doesn’t work as expected? custom actions doesn’t get triggered at all.
@nik202
nik202
(NiK202)
January 27, 2022, 10:56am
13
@jpark2111
Did you update the value of the image in the docker-compose.override.yml as such?
version: '3.4'
services:
app:
image: <account_username>/<repository_name>:<new_custom_image_tag>
jpark2111
(Jea Hyun Park)
January 27, 2022, 4:38pm
14
Yes I did, once I updated it with new image built by github action it doesn’t work
nik202
(NiK202)
January 27, 2022, 5:35pm
15
@jpark2111 share mein GitHub Action code, docker-compose.override.yml and docker ps please.