source: trunk/daemon/togad.py @ 46

Last change on this file since 46 was 46, checked in by bastiaans, 19 years ago

daemon/togad.py:

Added extra debug msg

File size: 19.1 KB
Line 
1#!/usr/bin/env python
2
3from xml.sax import make_parser
4from xml.sax.handler import ContentHandler
5import socket
6import sys
7import string
8import os
9import os.path
10import time
11import re
12import threading
13import mutex
14import random
15from types import *
16
17# Specify debugging level here;
18#
19# 11 = XML: metrics
20# 10 = XML: host, cluster, grid, ganglia
21# 9  = RRD activity, gmetad config parsing
22# 8  = RRD file activity
23# 7  = daemon threading
24#
25DEBUG_LEVEL = 7
26
27# Where is the gmetad.conf located
28#
29GMETAD_CONF = '/etc/gmetad.conf'
30
31# Where to store the archived rrd's
32#
33ARCHIVE_PATH = '/data/toga/rrds'
34
35# List of data_source names to archive for
36#
37ARCHIVE_SOURCES = [ "LISA Cluster" ]
38
39# Amount of hours to store in one single archived .rrd
40#
41ARCHIVE_HOURS_PER_RRD = 12
42
43# Wether or not to run as a daemon in background
44#
45DAEMONIZE = 0
46
47######################
48#                    #
49# Configuration ends #
50#                    #
51######################
52
53# What XML data types not to store
54#
55UNSUPPORTED_ARCHIVE_TYPES = [ 'string' ]
56
57"""
58This is TOrque-GAnglia's data Daemon
59"""
60
61class RRDMutator:
62        "A class for handling .rrd mutations"
63
64        binary = '/usr/bin/rrdtool'
65
66        def __init__( self, binary=None ):
67
68                if binary:
69                        self.binary = binary
70
71        def create( self, filename, args ):
72                return self.perform( 'create', '"' + filename + '"', args )
73
74        def update( self, filename, args ):
75                return self.perform( 'update', '"' + filename + '"', args )
76
77        def grabLastUpdate( self, filename ):
78
79                last_update = 0
80
81                for line in os.popen( self.binary + ' info "' + filename + '"' ).readlines():
82
83                        if line.find( 'last_update') != -1:
84
85                                last_update = line.split( ' = ' )[1]
86
87                if last_update:
88                        return last_update
89                else:
90                        return 0
91
92        def perform( self, action, filename, args ):
93
94                arg_string = None
95
96                if type( args ) is not ListType:
97                        debug_msg( 8, 'Arguments needs to be of type List' )
98                        return 1
99
100                for arg in args:
101
102                        if not arg_string:
103
104                                arg_string = arg
105                        else:
106                                arg_string = arg_string + ' ' + arg
107
108                debug_msg( 8, 'rrdm.perform(): ' + self.binary + ' ' + action + ' ' + filename + ' ' + arg_string  )
109
110                for line in os.popen( self.binary + ' ' + action + ' ' + filename + ' ' + arg_string ).readlines():
111
112                        if line.find( 'ERROR' ) != -1:
113
114                                error_msg = string.join( line.split( ' ' )[1:] )
115                                debug_msg( 8, error_msg )
116                                return 1
117
118                return 0
119
120class GangliaXMLHandler( ContentHandler ):
121        "Parse Ganglia's XML"
122
123        def __init__( self, config ):
124                self.config = config
125                self.clusters = { }
126                debug_msg( 0, printTime() + ' Gathering cluster timeserials and RRD last updates..' )
127                self.gatherClusters()
128                debug_msg( 0, printTime() + ' Done gathering timeserials and last updates.' )
129
130        def gatherClusters( self ):
131
132                archive_dir = check_dir(ARCHIVE_PATH)
133
134                hosts = [ ]
135
136                if os.path.exists( archive_dir ):
137
138                        dirlist = os.listdir( archive_dir )
139
140                        for item in dirlist:
141
142                                clustername = item
143
144                                if not self.clusters.has_key( clustername ) and clustername in ARCHIVE_SOURCES:
145
146                                        self.clusters[ clustername ] = RRDHandler( self.config, clustername )
147
148        def startElement( self, name, attrs ):
149                "Store appropriate data from xml start tags"
150
151                if name == 'GANGLIA_XML':
152
153                        self.XMLSource = attrs.get( 'SOURCE', "" )
154                        self.gangliaVersion = attrs.get( 'VERSION', "" )
155
156                        debug_msg( 10, 'Found XML data: source %s version %s' %( self.XMLSource, self.gangliaVersion ) )
157
158                elif name == 'GRID':
159
160                        self.gridName = attrs.get( 'NAME', "" )
161                        self.time = attrs.get( 'LOCALTIME', "" )
162
163                        debug_msg( 10, '`-Grid found: %s' %( self.gridName ) )
164
165                elif name == 'CLUSTER':
166
167                        self.clusterName = attrs.get( 'NAME', "" )
168                        self.time = attrs.get( 'LOCALTIME', "" )
169
170                        if not self.clusters.has_key( self.clusterName ) and self.clusterName in ARCHIVE_SOURCES:
171
172                                self.clusters[ self.clusterName ] = RRDHandler( self.config, self.clusterName )
173
174                                debug_msg( 10, ' |-Cluster found: %s' %( self.clusterName ) )
175
176                elif name == 'HOST' and self.clusterName in ARCHIVE_SOURCES:     
177
178                        self.hostName = attrs.get( 'NAME', "" )
179                        self.hostIp = attrs.get( 'IP', "" )
180                        self.hostReported = attrs.get( 'REPORTED', "" )
181
182                        debug_msg( 10, ' | |-Host found: %s - ip %s reported %s' %( self.hostName, self.hostIp, self.hostReported ) )
183
184                elif name == 'METRIC' and self.clusterName in ARCHIVE_SOURCES:
185
186                        type = attrs.get( 'TYPE', "" )
187
188                        if type not in UNSUPPORTED_ARCHIVE_TYPES:
189
190                                myMetric = { }
191                                myMetric['name'] = attrs.get( 'NAME', "" )
192                                myMetric['val'] = attrs.get( 'VAL', "" )
193                                myMetric['time'] = self.hostReported
194
195                                self.clusters[ self.clusterName ].memMetric( self.hostName, myMetric )
196
197                                debug_msg( 11, ' | | |-metric: %s:%s' %( myMetric['name'], myMetric['val'] ) )
198
199        def storeMetrics( self ):
200
201                for clustername, rrdh in self.clusters.items():
202
203                        ret = rrdh.storeMetrics()
204
205                        if ret:
206                                debug_msg( 9, 'An error occured while storing metrics for cluster %s' %clustername )
207                                return 1
208
209                return 0
210
211class GangliaXMLGatherer:
212        "Setup a connection and file object to Ganglia's XML"
213
214        s = None
215
216        def __init__( self, host, port ):
217                "Store host and port for connection"
218
219                self.host = host
220                self.port = port
221                self.connect()
222
223        def connect( self ):
224                "Setup connection to XML source"
225
226                for res in socket.getaddrinfo( self.host, self.port, socket.AF_UNSPEC, socket.SOCK_STREAM ):
227
228                        af, socktype, proto, canonname, sa = res
229
230                        try:
231
232                                self.s = socket.socket( af, socktype, proto )
233
234                        except socket.error, msg:
235
236                                self.s = None
237                                continue
238
239                        try:
240
241                                self.s.connect( sa )
242
243                        except socket.error, msg:
244
245                                self.s.close()
246                                self.s = None
247                                continue
248
249                        break
250
251                if self.s is None:
252
253                        debug_msg( 0, 'Could not open socket' )
254                        sys.exit( 1 )
255
256        def disconnect( self ):
257                "Close socket"
258
259                if self.s:
260                        self.s.close()
261                        self.s = None
262
263        def __del__( self ):
264                "Kill the socket before we leave"
265
266                self.disconnect()
267
268        def getFileObject( self ):
269                "Connect, and return a file object"
270
271                if self.s:
272                        # Apearantly, only data is received when a connection is made
273                        # therefor, disconnect and connect
274                        #
275                        self.disconnect()
276                        self.connect()
277
278                return self.s.makefile( 'r' )
279
280class GangliaXMLProcessor:
281
282        def __init__( self ):
283                "Setup initial XML connection and handlers"
284
285                self.config = GangliaConfigParser( GMETAD_CONF )
286
287                self.myXMLGatherer = GangliaXMLGatherer( 'localhost', 8651 ) 
288                self.myParser = make_parser()   
289                self.myHandler = GangliaXMLHandler( self.config )
290                self.myParser.setContentHandler( self.myHandler )
291
292        def daemon( self ):
293                "Run as daemon forever"
294
295                self.DAEMON = 1
296
297                # Fork the first child
298                #
299                pid = os.fork()
300
301                if pid > 0:
302
303                        sys.exit(0)  # end parent
304
305                # creates a session and sets the process group ID
306                #
307                os.setsid()
308
309                # Fork the second child
310                #
311                pid = os.fork()
312
313                if pid > 0:
314
315                        sys.exit(0)  # end parent
316
317                # Go to the root directory and set the umask
318                #
319                os.chdir('/')
320                os.umask(0)
321
322                sys.stdin.close()
323                sys.stdout.close()
324                #sys.stderr.close()
325
326                os.open('/dev/null', 0)
327                os.dup(0)
328                os.dup(0)
329
330                self.run()
331
332        def printTime( self ):
333                "Print current time in human readable format"
334
335                return time.strftime("%a %d %b %Y %H:%M:%S")
336
337        def run( self ):
338                "Main thread"
339
340                xmlthread = threading.Thread( None, self.processXML, 'xmlthread' )
341                storethread = threading.Thread( None, self.storeMetrics, 'storethread' )
342
343                while( 1 ):
344
345                        if not xmlthread.isAlive():
346                                # Gather XML at the same interval as gmetad
347
348                                # threaded call to: self.processXML()
349                                #
350                                xmlthread = threading.Thread( None, self.processXML, 'xmlthread' )
351                                xmlthread.start()
352
353                        if not storethread.isAlive():
354                                # Store metrics every .. sec
355
356                                # threaded call to: self.storeMetrics()
357                                #
358                                storethread = threading.Thread( None, self.storeMetrics, 'storethread' )
359                                storethread.start()
360               
361                        # Just sleep a sec here, to prevent daemon from going mad. We're all threads here anyway
362                        time.sleep( 1 ) 
363
364        def storeMetrics( self ):
365                "Store metrics retained in memory to disk"
366
367                debug_msg( 7, self.printTime() + ' - storethread(): started.' )
368
369                # Store metrics somewhere between every 60 and 180 seconds
370                #
371                #STORE_INTERVAL = random.randint( 360, 640 )
372                STORE_INTERVAL = 16
373
374                storethread = threading.Thread( None, self.storeThread, 'storemetricthread' )
375                storethread.start()
376
377                debug_msg( 7, self.printTime() + ' - storethread(): Sleeping.. (%ss)' %STORE_INTERVAL )
378                time.sleep( STORE_INTERVAL )
379                debug_msg( 7, self.printTime() + ' - storethread(): Done sleeping.' )
380
381                if storethread.isAlive():
382
383                        debug_msg( 7, self.printTime() + ' - storethread(): storemetricthread() still running, waiting to finish..' )
384                        storethread.join( 180 ) # Maximum time is for storing thread to finish
385                        debug_msg( 7, self.printTime() + ' - storethread(): Done waiting.' )
386
387                debug_msg( 7, self.printTime() + ' - storethread(): finished.' )
388
389                return 0
390
391        def storeThread( self ):
392
393                debug_msg( 7, self.printTime() + ' - storemetricthread(): started.' )
394                debug_msg( 7, self.printTime() + ' - storemetricthread(): Storing data..' )
395                ret = self.myHandler.storeMetrics()
396                debug_msg( 7, self.printTime() + ' - storemetricthread(): Done storing.' )
397                debug_msg( 7, self.printTime() + ' - storemetricthread(): finished.' )
398               
399                return ret
400
401        def processXML( self ):
402                "Process XML"
403
404                debug_msg( 7, self.printTime() + ' - xmlthread(): started.' )
405
406                parsethread = threading.Thread( None, self.parseThread, 'parsethread' )
407                parsethread.start()
408
409                debug_msg( 7, self.printTime() + ' - xmlthread(): Sleeping.. (%ss)' %self.config.getLowestInterval() )
410                time.sleep( float( self.config.getLowestInterval() ) ) 
411                debug_msg( 7, self.printTime() + ' - xmlthread(): Done sleeping.' )
412
413                if parsethread.isAlive():
414
415                        debug_msg( 7, self.printTime() + ' - xmlthread(): parsethread() still running, waiting to finish..' )
416                        parsethread.join( 180 ) # Maximum time for XML thread to finish
417                        debug_msg( 7, self.printTime() + ' - xmlthread(): Done waiting.' )
418
419                debug_msg( 7, self.printTime() + ' - xmlthread(): finished.' )
420
421                return 0
422
423        def parseThread( self ):
424
425                debug_msg( 7, self.printTime() + ' - parsethread(): started.' )
426                debug_msg( 7, self.printTime() + ' - parsethread(): Parsing XML..' )
427                ret = self.myParser.parse( self.myXMLGatherer.getFileObject() )
428                debug_msg( 7, self.printTime() + ' - parsethread(): Done parsing.' )
429                debug_msg( 7, self.printTime() + ' - parsethread(): finished.' )
430
431                return ret
432
433class GangliaConfigParser:
434
435        sources = [ ]
436
437        def __init__( self, config ):
438
439                self.config = config
440                self.parseValues()
441
442        def parseValues( self ):
443                "Parse certain values from gmetad.conf"
444
445                readcfg = open( self.config, 'r' )
446
447                for line in readcfg.readlines():
448
449                        if line.count( '"' ) > 1:
450
451                                if line.find( 'data_source' ) != -1 and line[0] != '#':
452
453                                        source = { }
454                                        source['name'] = line.split( '"' )[1]
455                                        source_words = line.split( '"' )[2].split( ' ' )
456
457                                        for word in source_words:
458
459                                                valid_interval = 1
460
461                                                for letter in word:
462
463                                                        if letter not in string.digits:
464
465                                                                valid_interval = 0
466
467                                                if valid_interval and len(word) > 0:
468
469                                                        source['interval'] = word
470                                                        debug_msg( 9, 'polling interval for %s = %s' %(source['name'], source['interval'] ) )
471       
472                                        # No interval found, use Ganglia's default     
473                                        if not source.has_key( 'interval' ):
474                                                source['interval'] = 15
475                                                debug_msg( 9, 'polling interval for %s defaulted to 15' %(source['name']) )
476
477                                        self.sources.append( source )
478
479        def getInterval( self, source_name ):
480
481                for source in self.sources:
482
483                        if source['name'] == source_name:
484
485                                return source['interval']
486
487                return None
488
489        def getLowestInterval( self ):
490
491                lowest_interval = 0
492
493                for source in self.sources:
494
495                        if not lowest_interval or source['interval'] <= lowest_interval:
496
497                                lowest_interval = source['interval']
498
499                # Return 15 when nothing is found, so that the daemon won't go insane with 0 sec delays
500                if lowest_interval:
501                        return lowest_interval
502                else:
503                        return 15
504
505class RRDHandler:
506
507        myMetrics = { }
508        lastStored = { }
509        slot = None
510
511        def __init__( self, config, cluster ):
512                self.block = 0
513                self.cluster = cluster
514                self.config = config
515                self.slot = threading.Lock()
516                self.rrdm = RRDMutator()
517                self.gatherLastUpdates()
518
519        def isBlocking( self ):
520
521                return self.block
522
523        def gatherLastUpdates( self ):
524                "Populate the lastStored list, containing timestamps of all last updates"
525
526                self.block = 1
527
528                cluster_dir = '%s/%s' %( check_dir(ARCHIVE_PATH), self.cluster )
529
530                hosts = [ ]
531
532                if os.path.exists( cluster_dir ):
533
534                        dirlist = os.listdir( cluster_dir )
535
536                        for dir in dirlist:
537
538                                hosts.append( dir )
539
540                for host in hosts:
541
542                        last_serial = self.getLastRrdTimeSerial( host )
543                        if last_serial:
544
545                                metric_dir = cluster_dir + '/' + host + '/' + last_serial
546                                if os.path.exists( metric_dir ):
547
548                                        dirlist = os.listdir( metric_dir )
549
550                                        for file in dirlist:
551
552                                                metricname = file.split( '.rrd' )[0]
553
554                                                if not self.lastStored.has_key( host ):
555
556                                                        self.lastStored[ host ] = { }
557
558                                                self.lastStored[ host ][ metricname ] = self.rrdm.grabLastUpdate( metric_dir + '/' + file )
559
560        def getClusterName( self ):
561                return self.cluster
562
563        def memMetric( self, host, metric ):
564
565                if self.myMetrics.has_key( host ):
566
567                        if self.myMetrics[ host ].has_key( metric['name'] ):
568
569                                for mymetric in self.myMetrics[ host ][ metric['name'] ]:
570
571                                        if mymetric['time'] == metric['time']:
572
573                                                # Allready have this metric, abort
574                                                return 1
575                        else:
576                                self.myMetrics[ host ][ metric['name'] ] = [ ]
577                else:
578                        self.myMetrics[ host ] = { }
579                        self.myMetrics[ host ][ metric['name'] ] = [ ]
580
581                # Ah, psst, push it
582                #
583                # <atomic>
584                self.slot.acquire()
585
586                self.myMetrics[ host ][ metric['name'] ].append( metric )
587
588                self.slot.release()
589                # </atomic>
590
591        def makeUpdateList( self, host, metricname ):
592
593                update_list = [ ]
594                metric = None
595
596                while len( self.myMetrics[ host ][ metricname ] ) > 0:
597
598                        # Kabouter pop
599                        #
600                        # <atomic>     
601                        self.slot.acquire()
602
603                        # len might have changed since loop start
604                        #
605                        if len( self.myMetrics[ host ][ metricname ] ) > 0:
606                                metric = self.myMetrics[ host ][ metricname ].pop( 0 )
607
608                        self.slot.release()
609                        # </atomic>
610
611                        if metric:
612                                if self.checkStoreMetric( host, metricname, metric ):
613                                        update_list.append( '%s:%s' %( metric['time'], metric['val'] ) )
614                                #else:
615                                        #print 'allready wrote metric %s with timestamp %s' %( metric['name'], metric['time'] )
616
617                return update_list
618
619        def checkStoreMetric( self, host, metricname, metric ):
620
621                if self.lastStored.has_key( host ):
622
623                        if self.lastStored[ host ].has_key( metricname ):
624
625                                if metric['time'] <= self.lastStored[ host ][ metricname ]:
626
627                                        # Allready wrote a value with this timestamp, skip tnx
628                                        return 0
629
630                else:
631                        self.lastStored[ host ] = { }
632
633                self.lastStored[ host ][ metricname ] = metric['time']
634
635                return 1
636
637        def storeMetrics( self ):
638
639                for hostname, mymetrics in self.myMetrics.items():     
640
641                        for metricname, mymetric in mymetrics.items():
642
643                                mytime = self.makeTimeSerial()
644                                correct_serial = self.checkNewRrdPeriod( hostname, mytime )
645                                self.createCheck( hostname, metricname, correct_serial )       
646                                update_ret = self.update( hostname, metricname, correct_serial )
647
648                                if update_ret == 0:
649
650                                        debug_msg( 9, 'stored metric %s for %s' %( hostname, metricname ) )
651                                else:
652                                        debug_msg( 9, 'metric update failed' )
653
654                                #sys.exit(1)
655
656        def makeTimeSerial( self ):
657                "Generate a time serial. Seconds since epoch"
658
659                # Seconds since epoch
660                mytime = int( time.time() )
661
662                return mytime
663
664        def makeRrdPath( self, host, metricname=None, timeserial=None ):
665                """
666                Make a RRD location/path and filename
667                If a metric or timeserial are supplied the complete locations
668                will be made, else just the host directory
669                """
670
671                if not timeserial:     
672                        rrd_dir = '%s/%s/%s' %( check_dir(ARCHIVE_PATH), self.cluster, host )
673                else:
674                        rrd_dir = '%s/%s/%s/%s' %( check_dir(ARCHIVE_PATH), self.cluster, host, timeserial )
675                if metricname:
676                        rrd_file = '%s/%s.rrd' %( rrd_dir, metricname )
677                else:
678                        rrd_file = None
679
680                return rrd_dir, rrd_file
681
682        def getLastRrdTimeSerial( self, host ):
683                """
684                Find the last timeserial (directory) for this host
685                This is determined once every host
686                """
687
688                rrd_dir, rrd_file = self.makeRrdPath( host )
689
690                newest_timeserial = 0
691
692                if os.path.exists( rrd_dir ):
693
694                        dirlist = os.listdir( rrd_dir )
695
696                        for dir in dirlist:
697
698                                valid_dir = 1
699
700                                for letter in dir:
701                                        if letter not in string.digits:
702                                                valid_dir = 0
703
704                                if valid_dir:
705                                        timeserial = dir
706                                        if timeserial > newest_timeserial:
707                                                newest_timeserial = timeserial
708
709                if newest_timeserial:
710                        return newest_timeserial
711                else:
712                        return 0
713
714        def checkNewRrdPeriod( self, host, current_timeserial ):
715                """
716                Check if current timeserial belongs to recent time period
717                or should become a new period (and file).
718
719                Returns the serial of the correct time period
720                """
721
722                last_timeserial = int( self.getLastRrdTimeSerial( host ) )
723                debug_msg( 9, 'last timeserial of %s is %s' %( host, last_timeserial ) )
724
725                if not last_timeserial:
726                        serial = current_timeserial
727                else:
728
729                        archive_secs = ARCHIVE_HOURS_PER_RRD * (60 * 60)
730
731                        if (current_timeserial - last_timeserial) >= archive_secs:
732                                serial = current_timeserial
733                        else:
734                                serial = last_timeserial
735
736                return serial
737
738        def getFirstTime( self, host, metricname ):
739                "Get the first time of a metric we know of"
740
741                first_time = 0
742
743                for metric in self.myMetrics[ host ][ metricname ]:
744
745                        if not first_time or metric['time'] <= first_time:
746
747                                first_time = metric['time']
748
749                return first_time
750
751        def createCheck( self, host, metricname, timeserial ):
752                "Check if an .rrd allready exists for this metric, create if not"
753
754                debug_msg( 9, 'rrdcreate: using timeserial %s for %s/%s' %( timeserial, host, metricname ) )
755
756                rrd_dir, rrd_file = self.makeRrdPath( host, metricname, timeserial )
757
758                if not os.path.exists( rrd_dir ):
759                        os.makedirs( rrd_dir )
760                        debug_msg( 9, 'created dir %s' %( str(rrd_dir) ) )
761
762                if not os.path.exists( rrd_file ):
763
764                        interval = self.config.getInterval( self.cluster )
765                        heartbeat = 8 * int(interval)
766
767                        params = [ ]
768
769                        params.append( '--step' )
770                        params.append( str( interval ) )
771
772                        params.append( '--start' )
773                        params.append( str( int( self.getFirstTime( host, metricname ) ) - 1 ) )
774
775                        params.append( 'DS:sum:GAUGE:%d:U:U' %heartbeat )
776                        params.append( 'RRA:AVERAGE:0.5:1:%s' %(ARCHIVE_HOURS_PER_RRD * 240) )
777
778                        self.rrdm.create( str(rrd_file), params )
779
780                        debug_msg( 9, 'created rrd %s' %( str(rrd_file) ) )
781
782        def update( self, host, metricname, timeserial ):
783
784                debug_msg( 9, 'rrdupdate: using timeserial %s for %s/%s' %( timeserial, host, metricname ) )
785
786                rrd_dir, rrd_file = self.makeRrdPath( host, metricname, timeserial )
787
788                update_list = self.makeUpdateList( host, metricname )
789
790                if len( update_list ) > 0:
791                        ret = self.rrdm.update( str(rrd_file), update_list )
792
793                        if ret:
794                                return 1
795               
796                        debug_msg( 9, 'updated rrd %s with %s' %( str(rrd_file), string.join( update_list ) ) )
797
798                return 0
799
800def main():
801        "Program startup"
802
803        myProcessor = GangliaXMLProcessor()
804
805        if DAEMONIZE:
806                myProcessor.daemon()
807        else:
808                myProcessor.run()
809
810def check_dir( directory ):
811        "Check if directory is a proper directory. I.e.: Does _not_ end with a '/'"
812
813        if directory[-1] == '/':
814                directory = directory[:-1]
815
816        return directory
817
818def debug_msg( level, msg ):
819
820        if (DEBUG_LEVEL >= level):
821                sys.stderr.write( msg + '\n' )
822
823def printTime( ):
824        "Print current time in human readable format"
825
826        return time.strftime("%a %d %b %Y %H:%M:%S")
827
828# Let's go
829if __name__ == '__main__':
830        main()
Note: See TracBrowser for help on using the repository browser.