Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Testing a client using a service container running the application

I have an application called doccano that's built with docker/docker compose and spins up a series of different containers to run the application. I have a package that is a client for interacting with the doccano application that I wish to test. I'm looking at spinning up the doccano application as a service for the pipeline. In the steps, I would like to be able to build my client package and test it against the running doccano service. If someone can just get me to being able to ping the service container from the step, the rest is trivial. This was very simple with github actions. 

....

  services:
    doccano:
      image:
        name: doccano/doccano
...

 - step:

    name: test

    services:
      - doccano
    script: 
      - export COMPOSER_ALLOW_SUPERUSER=1
      - apt-get update -qq
      - apt-get install apt-transport-https ca-certificates gnupg lsb-release git curl iputils-ping -y
      - ping -c 1 doccano

1 answer

1 accepted

1 vote
Answer accepted
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Feb 14, 2023

Hi @David Engelmann,

Welcome to the community.

I do believe the Docker image doccano/doccano is not intended to be used as a service on Pipelines as compared to MySQL Docker image here.
This is why you can't use the Docker image as a service directly.

What you could try differently is to run a Docker container directly on Pipelines using Docker commands (e.g. docker run).
Alternatively, you can also try using docker-compose as mentioned on the doccano Docker hub overview page.

Regards,
Mark C

I use the doccano image as a service in Github Actions without any issue, here is the workflow file - https://github.com/david-engelmann/DoccanoClient.jl/blob/main/.github/workflows/doccano_init.yml. I've tried installing it from docker run and docker compose and I'm not able to find a way to test interacting with it.

Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Feb 20, 2023

Hi @David Engelmann,

After further testing, instead of pinging the service, you can access it via the localhost on the specified port 8000.
Here's the exact YAML configuration that I used:

definitions:
  services:
    test-service:
      image: doccano/doccano
      variables:
        ADMIN_USERNAME: admin
        ADMIN_EMAIL: test123@gmail.com
        ADMIN_PASSWORD: password
        PORT: 8000

pipelines: 
  default: 
    - step: 
        script: 
          - curl http://127.0.0.1:8000/
        services:
          - docker
          - test-service

Hope it helps and do let me know if you have further questions.

Regards,
Mark C

Hi Mark, thank you for all your help. I've been able to see the presence of the services but my issue comes when trying to interact with it. Such as a POST request to test the login and csrf token mechanics. There isn't a technical/security reason why this would be impossible correct?

Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Feb 22, 2023

Hi @David Engelmann,

You'll just need to be aware of the limitations for services on Pipelines as highlighted in this documentation.

Regards,
Mark C

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events