Code Monkey home page Code Monkey logo

tutorial-environment's Introduction

Sample application for tutorials

This repository contains the environment for completing the tutorials at grafana.com/tutorials.

Prequisites

You will need to have the following installed locally to complete this workshop:

NOTE: If you're running Docker for Desktop for macOS or Windows, Docker Compose is already included in your installation.

Login

To log in browse to localhost:3000.

NOTE: To facilitate the demo, login has been disabled, and anonymous access is granted admin privileges. For security reasons, we advise keeping login enabled in your Grafana instance.

If you want to follow the tutorial with login enabled, you can comment the following lines of the docker-compose file

  - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin 
  - GF_AUTH_ANONYMOUS_ENABLED=true
  - GF_AUTH_BASIC_ENABLED=false

Once login is enabled, the default username and password is admin:admin

Running

To start the sample application and the supporting services:

docker-compose up -d

tutorial-environment's People

Contributors

jayclifford345 avatar marcusolsson avatar mdcruz avatar moxious avatar tonypowa avatar undef1nd avatar zuchka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tutorial-environment's Issues

Permission denied

I am running your app using Openshift as:

oc new-app https://github.com/grafana/tutorial-environment.git --context-dir=app

The app builds correct but then:

hesteban-redhat.com@bastion ~]$ oc get pods
NAME                                    READY   STATUS             RESTARTS   AGE
tutorial-environment-1-build            0/1     Completed          0          41m
tutorial-environment-54ff5f7f48-jzwj8   0/1     CrashLoopBackOff   12         41m
[hesteban-redhat.com@bastion ~]$ oc logs tutorial-environment-54ff5f7f48-jzwj8
/bin/sh: can't create /var/log/tns-app.log: Permission denied

Do you know what can I do to avoid the Permission denied?

Unable to docker-compose up on WSL2

System: WSL2, Ubuntu 20.04.3 LTS
Docker Version: Docker version 20.10.10, build b485636

When I pulled and ran docker-compose up -d I received the message
Error response from daemon: path /<path>/tutorial-environment/prometheus is mounted on / but it is not a shared mount.

I updated the docker-compose yml from
- ./prometheus/:/etc/prometheus/
to
- ./prometheus:/etc/prometheus

This fixed my issue. Not sure what impact this will have on other systems or docker versions

Prometheus Container throws 500 when starting up

Creating tutorial-environment_prometheus_1 ... error
Creating tutorial-environment_loki_1       ...

ERROR: for tutorial-environment_prometheus_1  Cannot create container for service prometheus: status code not OK but 500: ☺˙˙˙˙☺
☻BDocker.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null♣☺
                                                                      ocker.Core.DockerException
WatsonBuckets☺☺♥♥☺☺☺☺☺▲System.Collections.IDictionary►System.Excepti☻☻♠♥teStackTraceString►RemoteStackIndexExceptionMethodHResult♠Source
                                                                        ocker.Core.DockerException♠♦▲Filesharing has been cancelled


♠♣Ś‼   at Docker.ApiServices.Mounting.FileSharing.<DoShareAsync>d__7.MoveNext() in C:\workspaces\PR-16070\src\github.com\docker\pinata\win\src\Docker.ApiServices\Mounting\FileSharing.cs:line 0
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.ApiServices.Mounting.FileSharing.<ShareAsync>d__5.MoveNext() in C:\workspaces\PR-16070\src\github.com\docker\pinata\win\src\Docker.ApiServices\Mounting\FileSharing.cs:line 53
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.HttpApi.Controllers.FilesharingController.<ShareDirectory>d__2.MoveNext() in C:\workspaces\PR-16070\src\github.com\docker\pinata\win\src\Docker.HttpApi\Controllers\FilesharingController.cs:line 21
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__1`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

error: open /tmp/build/inputs/Dockerfile: no such file or directory in Openshift

Going to the app folder in your repo and doing:

$ oc new-app $(pwd) --strategy=docker

Gives:

Cloning "https://github.com/grafana/tutorial-environment.git" ...
	Commit:	fc499a0223a7b8fdc06e52ac389609b68ee02b7e (Update Grafana version)
	Author:	Marcus Olsson <[email protected]>
	Date:	Wed Jan 13 13:19:47 2021 +0100
error: open /tmp/build/inputs/Dockerfile: no such file or directory

Do you know the possible reason?

Cannot finish setup

Second time to run this demo on my mac and got the following error when I tried to execute the docker-compose:

Building app
Traceback (most recent call last):
File "docker-compose", line 3, in
File "compose/cli/main.py", line 67, in main
File "compose/cli/main.py", line 126, in perform_command
File "compose/cli/main.py", line 1070, in up
File "compose/cli/main.py", line 1066, in up
File "compose/project.py", line 615, in up
File "compose/service.py", line 362, in ensure_image_exists
File "compose/service.py", line 1125, in build
File "site-packages/docker/api/build.py", line 261, in build
File "site-packages/docker/api/build.py", line 308, in _set_auth_headers
File "site-packages/docker/auth.py", line 311, in get_all_credentials
File "site-packages/docker/auth.py", line 262, in _resolve_authconfig_credstore
File "site-packages/docker/auth.py", line 287, in _get_store_instance
File "site-packages/docker/credentials/store.py", line 25, in init
docker.credentials.errors.InitializationError: docker-credential-gcloud not installed or not available in PATH
[7458] Failed to execute script docker-compose

Raspberry Pi: App build error

Hi there!

When docker-compose up runs, the app and db seem to exit.

When attempting to docker-compose up the app alone, it gives the error: /app: line 1: syntax error: unexpected "("

Thanks :)

App fails to start

When I run docker-compose up -d; most of the containers start except "tutorial-environment_app" and "grafana/tns-db:latest". In looking at the docker logs, the following errors are reported:

In the "app" the error is:

./app: 1: Syntax error: "(" unexpected

In the db container, the error is:

standard_init_linux.go:228: exec user process caused: exec format error

I am running this on a Raspberry PI with the 64 bit OS .

Any ideas?

Clone is getting aborted

while cloning this repo in my local environment getting this error BUG: refs/files-backend.c:2956: initial ref transaction called with existing refs
Aborted (core dumped)

Timeout errors during startup

My system: MacOS 11.5.2
Docker version 20.10.8

Steps to reproduce:
git clone https://github.com/grafana/tutorial-environment.git
cd tutorial-environment/
docker ps [no running containers]
docker-compose up -d

Error:

Starting tutorial-environment_db_1 ... 
Starting tutorial-environment_promtail_1 ... 
Starting tutorial-environment_app_1        ... 
Starting tutorial-environment_loki_1       ... 
Starting tutorial-environment_grafana_1    ... 
Starting tutorial-environment_prometheus_1 ... 

ERROR: for tutorial-environment_promtail_1  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for tutorial-environment_prometheus_1  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for tutorial-environment_loki_1  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for tutorial-environment_app_1  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for tutorial-environment_db_1  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for tutorial-environment_grafana_1  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for promtail  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for prometheus  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for loki  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for app  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for db  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for grafana  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).

loki can not start

I just clone the tutorial and start it.but loki can not start.

➜ tutorial-environment git:(master) docker-compose ps
Name Command State Ports

tutorial-environment_app_1 /bin/sh -c /app http://db ... Up 0.0.0.0:8081->80/tcp
tutorial-environment_db_1 /db Up 0.0.0.0:8082->80/tcp
tutorial-environment_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp
tutorial-environment_loki_1 /usr/bin/loki -config.file ... Exit 1
tutorial-environment_prometheus_1 /bin/prometheus --config.f ... Up 0.0.0.0:9090->9090/tcp
tutorial-environment_promtail_1 /usr/bin/promtail -config. ... Up

so I pull latest grafana/loki again and restart,still the same.

docker-compose logs give me this hint:
loki_1 | failed parsing config: /etc/loki/local-config.yaml: not a valid duration string: "0"

can someone check the config yaml?

Podman on Fedora 36: /prometheus.yml: permission denied

Hello,

Trying to run the tutorial under Fedora 36 with podman. Downloading and setup succeed, but one of the containers exits right after launch. It says permission denied in the log:

$ podman logs tutorial-environment_prometheus_1 
ts=2022-10-16T15:47:44.754Z caller=main.go:438 level=error msg="Error loading config (--config.file=/etc/prometheus/prometheus.yml)" file=/etc/prometheus/prometheus.yml err="open /etc/prometheus/prometheus.yml: permission denied"

What can I do to make Prometheus start normally, and finally complete the tutorial?

Thanks,
FWieP

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.